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.Legacy
  4  * @subpackage  Controller
  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 /**
 13  * Controller tailored to suit most form-based admin operations.
 14  *
 15  * @since  1.6
 16  * @todo   Add ability to set redirect manually to better cope with frontend usage.
 17  */
 18 class JControllerForm extends JControllerLegacy
 19 {
 20     /**
 21      * The context for storing internal data, e.g. record.
 22      *
 23      * @var    string
 24      * @since  1.6
 25      */
 26     protected $context;
 27 
 28     /**
 29      * The URL option for the component.
 30      *
 31      * @var    string
 32      * @since  1.6
 33      */
 34     protected $option;
 35 
 36     /**
 37      * The URL view item variable.
 38      *
 39      * @var    string
 40      * @since  1.6
 41      */
 42     protected $view_item;
 43 
 44     /**
 45      * The URL view list variable.
 46      *
 47      * @var    string
 48      * @since  1.6
 49      */
 50     protected $view_list;
 51 
 52     /**
 53      * The prefix to use with controller messages.
 54      *
 55      * @var    string
 56      * @since  1.6
 57      */
 58     protected $text_prefix;
 59 
 60     /**
 61      * Constructor.
 62      *
 63      * @param   array  $config  An optional associative array of configuration settings.
 64      *
 65      * @see     JControllerLegacy
 66      * @since   1.6
 67      * @throws  Exception
 68      */
 69     public function __construct($config = array())
 70     {
 71         parent::__construct($config);
 72 
 73         // Guess the option as com_NameOfController
 74         if (empty($this->option))
 75         {
 76             $this->option = 'com_' . strtolower($this->getName());
 77         }
 78 
 79         // Guess the JText message prefix. Defaults to the option.
 80         if (empty($this->text_prefix))
 81         {
 82             $this->text_prefix = strtoupper($this->option);
 83         }
 84 
 85         // Guess the context as the suffix, eg: OptionControllerContent.
 86         if (empty($this->context))
 87         {
 88             $r = null;
 89 
 90             if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r))
 91             {
 92                 throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
 93             }
 94 
 95             $this->context = strtolower($r[2]);
 96         }
 97 
 98         // Guess the item view as the context.
 99         if (empty($this->view_item))
100         {
101             $this->view_item = $this->context;
102         }
103 
104         // Guess the list view as the plural of the item view.
105         if (empty($this->view_list))
106         {
107             // @TODO Probably worth moving to an inflector class based on
108             // http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
109 
110             // Simple pluralisation based on public domain snippet by Paul Osman
111             // For more complex types, just manually set the variable in your class.
112             $plural = array(
113                 array('/(x|ch|ss|sh)$/i', "$1es"),
114                 array('/([^aeiouy]|qu)y$/i', "$1ies"),
115                 array('/([^aeiouy]|qu)ies$/i', "$1y"),
116                 array('/(bu)s$/i', "$1ses"),
117                 array('/s$/i', 's'),
118                 array('/$/', 's'),
119             );
120 
121             // Check for matches using regular expressions
122             foreach ($plural as $pattern)
123             {
124                 if (preg_match($pattern[0], $this->view_item))
125                 {
126                     $this->view_list = preg_replace($pattern[0], $pattern[1], $this->view_item);
127                     break;
128                 }
129             }
130         }
131 
132         // Apply, Save & New, and Save As copy should be standard on forms.
133         $this->registerTask('apply', 'save');
134         $this->registerTask('save2new', 'save');
135         $this->registerTask('save2copy', 'save');
136     }
137 
138     /**
139      * Method to add a new record.
140      *
141      * @return  boolean  True if the record can be added, false if not.
142      *
143      * @since   1.6
144      */
145     public function add()
146     {
147         $context = "$this->option.edit.$this->context";
148 
149         // Access check.
150         if (!$this->allowAdd())
151         {
152             // Set the internal error and also the redirect error.
153             $this->setError(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'));
154             $this->setMessage($this->getError(), 'error');
155 
156             $this->setRedirect(
157                 JRoute::_(
158                     'index.php?option=' . $this->option . '&view=' . $this->view_list
159                     . $this->getRedirectToListAppend(), false
160                 )
161             );
162 
163             return false;
164         }
165 
166         // Clear the record edit information from the session.
167         JFactory::getApplication()->setUserState($context . '.data', null);
168 
169         // Redirect to the edit screen.
170         $this->setRedirect(
171             JRoute::_(
172                 'index.php?option=' . $this->option . '&view=' . $this->view_item
173                 . $this->getRedirectToItemAppend(), false
174             )
175         );
176 
177         return true;
178     }
179 
180     /**
181      * Method to check if you can add a new record.
182      *
183      * Extended classes can override this if necessary.
184      *
185      * @param   array  $data  An array of input data.
186      *
187      * @return  boolean
188      *
189      * @since   1.6
190      */
191     protected function allowAdd($data = array())
192     {
193         $user = JFactory::getUser();
194 
195         return $user->authorise('core.create', $this->option) || count($user->getAuthorisedCategories($this->option, 'core.create'));
196     }
197 
198     /**
199      * Method to check if you can edit an existing record.
200      *
201      * Extended classes can override this if necessary.
202      *
203      * @param   array   $data  An array of input data.
204      * @param   string  $key   The name of the key for the primary key; default is id.
205      *
206      * @return  boolean
207      *
208      * @since   1.6
209      */
210     protected function allowEdit($data = array(), $key = 'id')
211     {
212         return JFactory::getUser()->authorise('core.edit', $this->option);
213     }
214 
215     /**
216      * Method to check if you can save a new or existing record.
217      *
218      * Extended classes can override this if necessary.
219      *
220      * @param   array   $data  An array of input data.
221      * @param   string  $key   The name of the key for the primary key.
222      *
223      * @return  boolean
224      *
225      * @since   1.6
226      */
227     protected function allowSave($data, $key = 'id')
228     {
229         $recordId = isset($data[$key]) ? $data[$key] : '0';
230 
231         if ($recordId)
232         {
233             return $this->allowEdit($data, $key);
234         }
235         else
236         {
237             return $this->allowAdd($data);
238         }
239     }
240 
241     /**
242      * Method to run batch operations.
243      *
244      * @param   JModelLegacy  $model  The model of the component being processed.
245      *
246      * @return  boolean  True if successful, false otherwise and internal error is set.
247      *
248      * @since   1.7
249      */
250     public function batch($model)
251     {
252         $vars = $this->input->post->get('batch', array(), 'array');
253         $cid  = $this->input->post->get('cid', array(), 'array');
254 
255         // Build an array of item contexts to check
256         $contexts = array();
257 
258         $option = isset($this->extension) ? $this->extension : $this->option;
259 
260         foreach ($cid as $id)
261         {
262             // If we're coming from com_categories, we need to use extension vs. option
263             $contexts[$id] = $option . '.' . $this->context . '.' . $id;
264         }
265 
266         // Attempt to run the batch operation.
267         if ($model->batch($vars, $cid, $contexts))
268         {
269             $this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_BATCH'));
270 
271             return true;
272         }
273         else
274         {
275             $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_FAILED', $model->getError()), 'warning');
276 
277             return false;
278         }
279     }
280 
281     /**
282      * Method to cancel an edit.
283      *
284      * @param   string  $key  The name of the primary key of the URL variable.
285      *
286      * @return  boolean  True if access level checks pass, false otherwise.
287      *
288      * @since   1.6
289      */
290     public function cancel($key = null)
291     {
292         JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
293 
294         $model = $this->getModel();
295         $table = $model->getTable();
296         $context = "$this->option.edit.$this->context";
297 
298         if (empty($key))
299         {
300             $key = $table->getKeyName();
301         }
302 
303         $recordId = $this->input->getInt($key);
304 
305         // Attempt to check-in the current record.
306         if ($recordId)
307         {
308             if (property_exists($table, 'checked_out'))
309             {
310                 if ($model->checkin($recordId) === false)
311                 {
312                     // Check-in failed, go back to the record and display a notice.
313                     $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
314                     $this->setMessage($this->getError(), 'error');
315 
316                     $this->setRedirect(
317                         JRoute::_(
318                             'index.php?option=' . $this->option . '&view=' . $this->view_item
319                             . $this->getRedirectToItemAppend($recordId, $key), false
320                         )
321                     );
322 
323                     return false;
324                 }
325             }
326         }
327 
328         // Clean the session data and redirect.
329         $this->releaseEditId($context, $recordId);
330         JFactory::getApplication()->setUserState($context . '.data', null);
331 
332         $this->setRedirect(
333             JRoute::_(
334                 'index.php?option=' . $this->option . '&view=' . $this->view_list
335                 . $this->getRedirectToListAppend(), false
336             )
337         );
338 
339         return true;
340     }
341 
342     /**
343      * Method to edit an existing record.
344      *
345      * @param   string  $key     The name of the primary key of the URL variable.
346      * @param   string  $urlVar  The name of the URL variable if different from the primary key
347      *                           (sometimes required to avoid router collisions).
348      *
349      * @return  boolean  True if access level check and checkout passes, false otherwise.
350      *
351      * @since   1.6
352      */
353     public function edit($key = null, $urlVar = null)
354     {
355         // Do not cache the response to this, its a redirect, and mod_expires and google chrome browser bugs cache it forever!
356         JFactory::getApplication()->allowCache(false);
357 
358         $model = $this->getModel();
359         $table = $model->getTable();
360         $cid   = $this->input->post->get('cid', array(), 'array');
361         $context = "$this->option.edit.$this->context";
362 
363         // Determine the name of the primary key for the data.
364         if (empty($key))
365         {
366             $key = $table->getKeyName();
367         }
368 
369         // To avoid data collisions the urlVar may be different from the primary key.
370         if (empty($urlVar))
371         {
372             $urlVar = $key;
373         }
374 
375         // Get the previous record id (if any) and the current record id.
376         $recordId = (int) (count($cid) ? $cid[0] : $this->input->getInt($urlVar));
377         $checkin = property_exists($table, $table->getColumnAlias('checked_out'));
378 
379         // Access check.
380         if (!$this->allowEdit(array($key => $recordId), $key))
381         {
382             $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
383             $this->setMessage($this->getError(), 'error');
384 
385             $this->setRedirect(
386                 JRoute::_(
387                     'index.php?option=' . $this->option . '&view=' . $this->view_list
388                     . $this->getRedirectToListAppend(), false
389                 )
390             );
391 
392             return false;
393         }
394 
395         // Attempt to check-out the new record for editing and redirect.
396         if ($checkin && !$model->checkout($recordId))
397         {
398             // Check-out failed, display a notice but allow the user to see the record.
399             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKOUT_FAILED', $model->getError()));
400             $this->setMessage($this->getError(), 'error');
401 
402             $this->setRedirect(
403                 JRoute::_(
404                     'index.php?option=' . $this->option . '&view=' . $this->view_item
405                     . $this->getRedirectToItemAppend($recordId, $urlVar), false
406                 )
407             );
408 
409             return false;
410         }
411         else
412         {
413             // Check-out succeeded, push the new record id into the session.
414             $this->holdEditId($context, $recordId);
415             JFactory::getApplication()->setUserState($context . '.data', null);
416 
417             $this->setRedirect(
418                 JRoute::_(
419                     'index.php?option=' . $this->option . '&view=' . $this->view_item
420                     . $this->getRedirectToItemAppend($recordId, $urlVar), false
421                 )
422             );
423 
424             return true;
425         }
426     }
427 
428     /**
429      * Method to get a model object, loading it if required.
430      *
431      * @param   string  $name    The model name. Optional.
432      * @param   string  $prefix  The class prefix. Optional.
433      * @param   array   $config  Configuration array for model. Optional.
434      *
435      * @return  JModelLegacy  The model.
436      *
437      * @since   1.6
438      */
439     public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
440     {
441         if (empty($name))
442         {
443             $name = $this->context;
444         }
445 
446         return parent::getModel($name, $prefix, $config);
447     }
448 
449     /**
450      * Gets the URL arguments to append to an item redirect.
451      *
452      * @param   integer  $recordId  The primary key id for the item.
453      * @param   string   $urlVar    The name of the URL variable for the id.
454      *
455      * @return  string  The arguments to append to the redirect URL.
456      *
457      * @since   1.6
458      */
459     protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
460     {
461         $append = '';
462 
463         // Setup redirect info.
464         if ($tmpl = $this->input->get('tmpl', '', 'string'))
465         {
466             $append .= '&tmpl=' . $tmpl;
467         }
468 
469         if ($layout = $this->input->get('layout', 'edit', 'string'))
470         {
471             $append .= '&layout=' . $layout;
472         }
473 
474         if ($forcedLanguage = $this->input->get('forcedLanguage', '', 'cmd'))
475         {
476             $append .= '&forcedLanguage=' . $forcedLanguage;
477         }
478 
479         if ($recordId)
480         {
481             $append .= '&' . $urlVar . '=' . $recordId;
482         }
483 
484         $return = $this->input->get('return', null, 'base64');
485 
486         if ($return)
487         {
488             $append .= '&return=' . $return;
489         }
490 
491         return $append;
492     }
493 
494     /**
495      * Gets the URL arguments to append to a list redirect.
496      *
497      * @return  string  The arguments to append to the redirect URL.
498      *
499      * @since   1.6
500      */
501     protected function getRedirectToListAppend()
502     {
503         $append = '';
504 
505         // Setup redirect info.
506         if ($tmpl = $this->input->get('tmpl', '', 'string'))
507         {
508             $append .= '&tmpl=' . $tmpl;
509         }
510 
511         if ($forcedLanguage = $this->input->get('forcedLanguage', '', 'cmd'))
512         {
513             $append .= '&forcedLanguage=' . $forcedLanguage;
514         }
515 
516         return $append;
517     }
518 
519     /**
520      * Function that allows child controller access to model data
521      * after the data has been saved.
522      *
523      * @param   JModelLegacy  $model      The data model object.
524      * @param   array         $validData  The validated data.
525      *
526      * @return  void
527      *
528      * @since   1.6
529      */
530     protected function postSaveHook(JModelLegacy $model, $validData = array())
531     {
532     }
533 
534     /**
535      * Method to load a row from version history
536      *
537      * @return  mixed  True if the record can be added, an error object if not.
538      *
539      * @since   3.2
540      */
541     public function loadhistory()
542     {
543         $model = $this->getModel();
544         $table = $model->getTable();
545         $historyId = $this->input->getInt('version_id', null);
546 
547         if (!$model->loadhistory($historyId, $table))
548         {
549             $this->setMessage($model->getError(), 'error');
550 
551             $this->setRedirect(
552                 JRoute::_(
553                     'index.php?option=' . $this->option . '&view=' . $this->view_list
554                     . $this->getRedirectToListAppend(), false
555                 )
556             );
557 
558             return false;
559         }
560 
561         // Determine the name of the primary key for the data.
562         if (empty($key))
563         {
564             $key = $table->getKeyName();
565         }
566 
567         $recordId = $table->$key;
568 
569         // To avoid data collisions the urlVar may be different from the primary key.
570         $urlVar = empty($this->urlVar) ? $key : $this->urlVar;
571 
572         // Access check.
573         if (!$this->allowEdit(array($key => $recordId), $key))
574         {
575             $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
576             $this->setMessage($this->getError(), 'error');
577 
578             $this->setRedirect(
579                 JRoute::_(
580                     'index.php?option=' . $this->option . '&view=' . $this->view_list
581                     . $this->getRedirectToListAppend(), false
582                 )
583             );
584             $table->checkin();
585 
586             return false;
587         }
588 
589         $table->store();
590         $this->setRedirect(
591             JRoute::_(
592                 'index.php?option=' . $this->option . '&view=' . $this->view_item
593                 . $this->getRedirectToItemAppend($recordId, $urlVar), false
594             )
595         );
596 
597         $this->setMessage(
598             JText::sprintf(
599                 'JLIB_APPLICATION_SUCCESS_LOAD_HISTORY', $model->getState('save_date'), $model->getState('version_note')
600             )
601         );
602 
603         // Invoke the postSave method to allow for the child class to access the model.
604         $this->postSaveHook($model);
605 
606         return true;
607     }
608 
609     /**
610      * Method to save a record.
611      *
612      * @param   string  $key     The name of the primary key of the URL variable.
613      * @param   string  $urlVar  The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
614      *
615      * @return  boolean  True if successful, false otherwise.
616      *
617      * @since   1.6
618      */
619     public function save($key = null, $urlVar = null)
620     {
621         // Check for request forgeries.
622         JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
623 
624         $app   = JFactory::getApplication();
625         $model = $this->getModel();
626         $table = $model->getTable();
627         $data  = $this->input->post->get('jform', array(), 'array');
628         $checkin = property_exists($table, $table->getColumnAlias('checked_out'));
629         $context = "$this->option.edit.$this->context";
630         $task = $this->getTask();
631 
632         // Determine the name of the primary key for the data.
633         if (empty($key))
634         {
635             $key = $table->getKeyName();
636         }
637 
638         // To avoid data collisions the urlVar may be different from the primary key.
639         if (empty($urlVar))
640         {
641             $urlVar = $key;
642         }
643 
644         $recordId = $this->input->getInt($urlVar);
645 
646         // Populate the row id from the session.
647         $data[$key] = $recordId;
648 
649         // The save2copy task needs to be handled slightly differently.
650         if ($task == 'save2copy')
651         {
652             // Check-in the original row.
653             if ($checkin && $model->checkin($data[$key]) === false)
654             {
655                 // Check-in failed. Go back to the item and display a notice.
656                 $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
657                 $this->setMessage($this->getError(), 'error');
658 
659                 $this->setRedirect(
660                     JRoute::_(
661                         'index.php?option=' . $this->option . '&view=' . $this->view_item
662                         . $this->getRedirectToItemAppend($recordId, $urlVar), false
663                     )
664                 );
665 
666                 return false;
667             }
668 
669             // Reset the ID, the multilingual associations and then treat the request as for Apply.
670             $data[$key] = 0;
671             $data['associations'] = array();
672             $task = 'apply';
673         }
674 
675         // Access check.
676         if (!$this->allowSave($data, $key))
677         {
678             $this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
679             $this->setMessage($this->getError(), 'error');
680 
681             $this->setRedirect(
682                 JRoute::_(
683                     'index.php?option=' . $this->option . '&view=' . $this->view_list
684                     . $this->getRedirectToListAppend(), false
685                 )
686             );
687 
688             return false;
689         }
690 
691         // Validate the posted data.
692         // Sometimes the form needs some posted data, such as for plugins and modules.
693         $form = $model->getForm($data, false);
694 
695         if (!$form)
696         {
697             $app->enqueueMessage($model->getError(), 'error');
698 
699             return false;
700         }
701 
702         // Test whether the data is valid.
703         $validData = $model->validate($form, $data);
704 
705         // Check for validation errors.
706         if ($validData === false)
707         {
708             // Get the validation messages.
709             $errors = $model->getErrors();
710 
711             // Push up to three validation messages out to the user.
712             for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
713             {
714                 if ($errors[$i] instanceof Exception)
715                 {
716                     $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
717                 }
718                 else
719                 {
720                     $app->enqueueMessage($errors[$i], 'warning');
721                 }
722             }
723 
724             // Save the data in the session.
725             $app->setUserState($context . '.data', $data);
726 
727             // Redirect back to the edit screen.
728             $this->setRedirect(
729                 JRoute::_(
730                     'index.php?option=' . $this->option . '&view=' . $this->view_item
731                     . $this->getRedirectToItemAppend($recordId, $urlVar), false
732                 )
733             );
734 
735             return false;
736         }
737 
738         if (!isset($validData['tags']))
739         {
740             $validData['tags'] = null;
741         }
742 
743         // Attempt to save the data.
744         if (!$model->save($validData))
745         {
746             // Save the data in the session.
747             $app->setUserState($context . '.data', $validData);
748 
749             // Redirect back to the edit screen.
750             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
751             $this->setMessage($this->getError(), 'error');
752 
753             $this->setRedirect(
754                 JRoute::_(
755                     'index.php?option=' . $this->option . '&view=' . $this->view_item
756                     . $this->getRedirectToItemAppend($recordId, $urlVar), false
757                 )
758             );
759 
760             return false;
761         }
762 
763         // Save succeeded, so check-in the record.
764         if ($checkin && $model->checkin($validData[$key]) === false)
765         {
766             // Save the data in the session.
767             $app->setUserState($context . '.data', $validData);
768 
769             // Check-in failed, so go back to the record and display a notice.
770             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
771             $this->setMessage($this->getError(), 'error');
772 
773             $this->setRedirect(
774                 JRoute::_(
775                     'index.php?option=' . $this->option . '&view=' . $this->view_item
776                     . $this->getRedirectToItemAppend($recordId, $urlVar), false
777                 )
778             );
779 
780             return false;
781         }
782 
783         $langKey = $this->text_prefix . ($recordId == 0 && $app->isClient('site') ? '_SUBMIT' : '') . '_SAVE_SUCCESS';
784         $prefix  = JFactory::getLanguage()->hasKey($langKey) ? $this->text_prefix : 'JLIB_APPLICATION';
785 
786         $this->setMessage(JText::_($prefix . ($recordId == 0 && $app->isClient('site') ? '_SUBMIT' : '') . '_SAVE_SUCCESS'));
787 
788         // Redirect the user and adjust session state based on the chosen task.
789         switch ($task)
790         {
791             case 'apply':
792                 // Set the record data in the session.
793                 $recordId = $model->getState($this->context . '.id');
794                 $this->holdEditId($context, $recordId);
795                 $app->setUserState($context . '.data', null);
796                 $model->checkout($recordId);
797 
798                 // Redirect back to the edit screen.
799                 $this->setRedirect(
800                     JRoute::_(
801                         'index.php?option=' . $this->option . '&view=' . $this->view_item
802                         . $this->getRedirectToItemAppend($recordId, $urlVar), false
803                     )
804                 );
805                 break;
806 
807             case 'save2new':
808                 // Clear the record id and data from the session.
809                 $this->releaseEditId($context, $recordId);
810                 $app->setUserState($context . '.data', null);
811 
812                 // Redirect back to the edit screen.
813                 $this->setRedirect(
814                     JRoute::_(
815                         'index.php?option=' . $this->option . '&view=' . $this->view_item
816                         . $this->getRedirectToItemAppend(null, $urlVar), false
817                     )
818                 );
819                 break;
820 
821             default:
822                 // Clear the record id and data from the session.
823                 $this->releaseEditId($context, $recordId);
824                 $app->setUserState($context . '.data', null);
825 
826                 $url = 'index.php?option=' . $this->option . '&view=' . $this->view_list
827                     . $this->getRedirectToListAppend();
828 
829                 // Check if there is a return value
830                 $return = $this->input->get('return', null, 'base64');
831 
832                 if (!is_null($return) && JUri::isInternal(base64_decode($return)))
833                 {
834                     $url = base64_decode($return);
835                 }
836 
837                 // Redirect to the list screen.
838                 $this->setRedirect(JRoute::_($url, false));
839                 break;
840         }
841 
842         // Invoke the postSave method to allow for the child class to access the model.
843         $this->postSaveHook($model, $validData);
844 
845         return true;
846     }
847 }
848 
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.