Open Journal Systems  3.3.0
PKPTemplateManager Class Reference
Inheritance diagram for PKPTemplateManager:
TemplateManager

Public Member Functions

 __construct ()
 
 addHeader ($name, $header, $args=[])
 
 addJavaScript ($name, $script, $args=[])
 
 addStyleSheet ($name, $style, $args=[])
 
 cacheLess ($path, $styles)
 
 clearCssCache ()
 
 clearTemplateCache ()
 
 clearThemeTemplateCache ($hookName, $args)
 
 compileLess ($name, $lessFile, $args=[])
 
 display ($template=null, $cache_id=null, $compile_id=null, $parent=null)
 
 displaySidebar ($hookName, $args)
 
 fetch ($template=null, $cache_id=null, $compile_id=null, $parent=null)
 
 fetchAjax ($id, $url, $element='div')
 
 fetchJson ($template, $status=true)
 
 flush ()
 
 get_template_vars ($varname=null)
 
 getCachedLessFilePath ($name)
 
 getCompileId ($resourceName)
 
 getFBV ()
 
 getResourcesByContext ($resources, $context)
 
 getState ($key)
 
 initialize ($request)
 
 loadHtmlGalleyStyles ($htmlContent, $embeddedFiles)
 
 register_function ($name, $impl, $cacheable=true, $cache_attrs=null)
 
 registerJSLibrary ()
 
 registerJSLibraryData ()
 
 setCacheability ($cacheability=CACHEABILITY_PUBLIC)
 
 setConstants ($names)
 
 setLocaleKeys ($keys)
 
 setState ($data)
 
 setupBackendPage ()
 
 smartyCallHook ($params, $smarty)
 
 smartyCompare ($a, $b, $strict=false, $invert=false)
 
 smartyConcat ()
 
 smartyCSRF ($params, $smarty)
 
 smartyEscape ($string, $esc_type='html', $char_set='ISO-8859-1')
 
 smartyExplode ($string, $separator)
 
 smartyFlush ($params, $smarty)
 
 smartyHelp ($params, $smarty)
 
 smartyHtmlOptionsTranslate ($params, $smarty)
 
 smartyIterate ($params, $content, $smarty, &$repeat)
 
 smartyLoadHeader ($params, $smarty)
 
 smartyLoadNavigationMenuArea ($params, $smarty)
 
 smartyLoadScript ($params, $smarty)
 
 smartyLoadStylesheet ($params, $smarty)
 
 smartyLoadUrlInDiv ($params, $smarty)
 
 smartyLoadUrlInEl ($params, $smarty)
 
 smartyNullLinkAction ($params, $smarty)
 
 smartyPageInfo ($params, $smarty)
 
 smartyPageLinks ($params, $smarty)
 
 smartyPluckFiles ($params, $smarty)
 
 smartyStrtotime ($string)
 
 smartyTitle ($parameters, $smarty)
 
 smartyToArray ()
 
 smartyTranslate ($params, $smarty)
 
 smartyUrl ($parameters, $smarty)
 

Static Public Member Functions

static & getManager ($request=null)
 

Detailed Description

Definition at line 50 of file PKPTemplateManager.inc.php.

Constructor & Destructor Documentation

◆ __construct()

PKPTemplateManager::__construct ( )

Constructor. Initialize template engine and assign basic template variables.

Definition at line 109 of file PKPTemplateManager.inc.php.

References Core\getBaseDir(), and CacheManager\getFileCachePath().

Member Function Documentation

◆ addHeader()

PKPTemplateManager::addHeader (   $name,
  $header,
  $args = [] 
)

Add a page-specific item to the <head>.

Parameters
$namestring Unique name for the header
$headerstring The header to be included.
$argsarray Key/value array defining display details priority int The order in which to print this header. Default: STYLE_SEQUENCE_NORMAL contexts string|array Where the header should be loaded. Default: array('frontend')

Definition at line 533 of file PKPTemplateManager.inc.php.

Referenced by initialize().

◆ addJavaScript()

PKPTemplateManager::addJavaScript (   $name,
  $script,
  $args = [] 
)

Register a script with the script handler

Parameters
$namestring Unique name for the script
$scriptstring The script to be included. Should be a URL or, if the inline argument is included, script data to be output.
$argsarray Key/value array defining display details priority int The order in which to print this script. Default: STYLE_SEQUENCE_NORMAL contexts string|array Where the script should be loaded. Default: array('frontend') inline bool Whether the $script value should be output directly as script data. Used to pass backend data to the scripts.

Definition at line 502 of file PKPTemplateManager.inc.php.

Referenced by display(), initialize(), registerJSLibrary(), registerJSLibraryData(), and setupBackendPage().

◆ addStyleSheet()

PKPTemplateManager::addStyleSheet (   $name,
  $style,
  $args = [] 
)

Register a stylesheet with the style handler

Parameters
$namestring Unique name for the stylesheet
$stylestring The stylesheet to be included. Should be a URL or, if the inline argument is included, stylesheet data to be output.
$argsarray Key/value array defining display details priority int The order in which to print this stylesheet. Default: STYLE_SEQUENCE_NORMAL contexts string|array Where the stylesheet should be loaded. Default: array('frontend') inline bool Whether the $stylesheet value should be output directly as stylesheet data. Used to pass backend data to the scripts.

Definition at line 468 of file PKPTemplateManager.inc.php.

Referenced by TemplateManager\initialize(), initialize(), and setupBackendPage().

◆ cacheLess()

PKPTemplateManager::cacheLess (   $path,
  $styles 
)

Save LESS styles to a cached file

Parameters
$pathstring File path to save the compiled styles
stylesstring CSS styles compiled from the LESS
Returns
bool success/failure

Definition at line 432 of file PKPTemplateManager.inc.php.

◆ clearCssCache()

PKPTemplateManager::clearCssCache ( )

Clear all compiled CSS files

Definition at line 1208 of file PKPTemplateManager.inc.php.

References CacheManager\getFileCachePath().

Referenced by clearThemeTemplateCache().

◆ clearTemplateCache()

PKPTemplateManager::clearTemplateCache ( )

Clear template compile and cache directories.

Definition at line 1200 of file PKPTemplateManager.inc.php.

Referenced by clearThemeTemplateCache().

◆ clearThemeTemplateCache()

PKPTemplateManager::clearThemeTemplateCache (   $hookName,
  $args 
)

Clear the cache when a context or site has changed it's active theme

Parameters
$hookNamestring
$argsarray [ @option Context|Site The new values @option Context|Site The old values @option array Key/value of params that were modified @option Request ]

Definition at line 1225 of file PKPTemplateManager.inc.php.

References clearCssCache(), and clearTemplateCache().

◆ compileLess()

PKPTemplateManager::compileLess (   $name,
  $lessFile,
  $args = [] 
)

Compile a LESS stylesheet

Parameters
$namestring Unique name for this LESS stylesheet
$lessFilestring Path to the LESS file to compile
$argsarray Optional arguments. Supports: 'baseUrl': Base URL to use when rewriting URLs in the LESS file. 'addLess': Array of additional LESS files to parse before compiling
Returns
string Compiled CSS styles

Definition at line 390 of file PKPTemplateManager.inc.php.

References HookRegistry\call().

◆ display()

PKPTemplateManager::display (   $template = null,
  $cache_id = null,
  $compile_id = null,
  $parent = null 
)

◆ displaySidebar()

PKPTemplateManager::displaySidebar (   $hookName,
  $args 
)

Display the sidebar

Parameters
$hookNamestring
$argsarray [ @option array Params passed to the hook @option Smarty @option string The output ]

Definition at line 1282 of file PKPTemplateManager.inc.php.

References PluginRegistry\loadCategory().

◆ fetch()

PKPTemplateManager::fetch (   $template = null,
  $cache_id = null,
  $compile_id = null,
  $parent = null 
)

◆ fetchAjax()

PKPTemplateManager::fetchAjax (   $id,
  $url,
  $element = 'div' 
)

Fetch content via AJAX and add it to the DOM, wrapped in a container element.

Parameters
$idstring ID to use for the generated container element.
$urlstring URL to fetch the contents from.
$elementstring Element to use for container.
Returns
JSONMessage The JSON-encoded result.

Definition at line 1088 of file PKPTemplateManager.inc.php.

References smartyLoadUrlInEl().

◆ fetchJson()

PKPTemplateManager::fetchJson (   $template,
  $status = true 
)

Returns the template results as a JSON message.

Parameters
$templatestring Template filename (or Smarty resource name)
$statusboolean
Returns
JSONMessage JSON object

Definition at line 1122 of file PKPTemplateManager.inc.php.

References fetch().

◆ flush()

PKPTemplateManager::flush ( )

Definition at line 1513 of file PKPTemplateManager.inc.php.

◆ get_template_vars()

PKPTemplateManager::get_template_vars (   $varname = null)

DEPRECATED wrapper for Smarty2 backwards compatibility

Parameters
$varname

Definition at line 2219 of file PKPTemplateManager.inc.php.

References Config\getVar().

Referenced by setupBackendPage().

◆ getCachedLessFilePath()

PKPTemplateManager::getCachedLessFilePath (   $name)

Retrieve the file path for a cached LESS file

Parameters
$namestring Unique name for the LESS file
Returns
$path string Path to the less file or false if not found

Definition at line 447 of file PKPTemplateManager.inc.php.

References CacheManager\getFileCachePath().

◆ getCompileId()

PKPTemplateManager::getCompileId (   $resourceName)

Calculate a compile ID for a resource.

Parameters
$resourceNamestring Resource name.
Returns
string

Definition at line 1104 of file PKPTemplateManager.inc.php.

References Config\getVar().

Referenced by display(), and fetch().

◆ getFBV()

PKPTemplateManager::getFBV ( )

Return an instance of the Form Builder Vocabulary class.

Returns
TemplateManager the template manager object

Definition at line 1264 of file PKPTemplateManager.inc.php.

Referenced by initialize().

◆ getManager()

static& PKPTemplateManager::getManager (   $request = null)
static

Return an instance of the template manager.

Parameters
$requestPKPRequest
Returns
TemplateManager the template manager object

Definition at line 1239 of file PKPTemplateManager.inc.php.

References Registry\get(), PluginRegistry\getPlugins(), Config\getVar(), and PluginRegistry\loadCategory().

Referenced by QuickSubmitPlugin\_cancelSubmit(), MarkupHandler\_conversion(), HtmlArticleGalleyPlugin\_getHTMLContents(), InformationCenterHandler\_listNotes(), FileInformationCenterHandler\_listPastNotes(), ThemePlugin\_registerScripts(), Plugin\_registerTemplateResource(), QuickSubmitPlugin\_reloadForm(), LegacyJR1\_reportXML(), PKPReviewRoundTabHandler\_reviewRound(), QuickSubmitPlugin\_saveSubmit(), IssueHandler\_setupIssueTemplate(), PKPCatalogHandler\_setupPaginationTemplate(), OrcidHandler\about(), AboutSiteHandler\aboutThisPublishingSystem(), ManagementHandler\access(), RegistrationHandler\activateUser(), UsageStatsPlugin\addJavascriptData(), URNPubIdPlugin\addPublicationFormFields(), ImmersionThemePlugin\addToIssueForm(), ManagementHandler\announcements(), IssueHandler\archive(), LensGalleyPlugin\articleCallback(), DublinCoreMetaPlugin\articleView(), HtmlArticleGalleyPlugin\articleViewCallback(), AssignToIssueHandler\assign(), PKPUserHandler\authorizationDenied(), InformationHandler\authorize(), AboutContextHandler\authorize(), SearchHandler\authors(), MarkupHandler\batch(), StaticPagesPlugin\callbackHandleContent(), SwordPlugin\callbackSettingsTab(), PKPCatalogHandler\category(), LoginHandler\changePassword(), AdminHandler\clearTemplateCache(), GatewayHandler\clockss(), AboutContextHandler\contact(), ManagementHandler\context(), AdminHandler\contexts(), PageHandler\css(), IssueHandler\current(), MaintenanceForm\dbInstallError(), DOIPubIdExportPlugin\display(), MaintenanceForm\display(), ViewSubmissionMetadataHandler\display(), UserRoleForm\display(), LoginChangePasswordForm\display(), PaypalPaymentForm\display(), DOAJExportPlugin\display(), PubMedExportPlugin\display(), QuickSubmitPlugin\display(), ImportExportPlugin\display(), NativeImportExportPlugin\display(), PKPUserImportExportPlugin\display(), UserForm\display(), AuthorDepositForm\display(), UserDisableForm\display(), SwordImportExportPlugin\display(), QuickSubmitForm\display(), UserInstitutionalSubscriptionForm\display(), UserIndividualSubscriptionForm\display(), PubObjectsExportPlugin\display(), InstallForm\display(), CounterReportPlugin\display(), UserDetailsForm\display(), SettingsHandler\distribution(), ManagementHandler\distribution(), DocumentLibraryHandler\documentLibrary(), ContextGridHandler\editContext(), ArticleGalleyGridHandler\editGalley(), IssueGridHandler\editIssue(), PKPManageFileApiHandler\editMetadata(), TextureHandler\editor(), PKPWorkflowHandler\editorDecisionActions(), PKPStatsHandler\editorial(), AboutContextHandler\editorialTeam(), ReviewFormGridHandler\editReviewForm(), PKPSiteHandler\editTheme(), PKPContextHandler\editTheme(), UpgradeForm\execute(), InstallForm\execute(), SubmissionSubmitStep1Form\fetch(), PublicIdentifiersForm\fetch(), RolesForm\fetch(), SubmissionSubmitStep3Form\fetch(), PKPReviewerReviewStep2Form\fetch(), ContactForm\fetch(), ReviewFormElements\fetch(), IssueAccessForm\fetch(), PreviewReviewForm\fetch(), AdvancedSearchReviewerForm\fetch(), PLNStatusForm\fetch(), ManageProofFilesForm\fetch(), InstallLanguageForm\fetch(), AssignPublicIdentifiersForm\fetch(), PKPReviewerReviewStep1Form\fetch(), NewLibraryFileForm\fetch(), IdentityForm\fetch(), PKPSubmissionSubmitStep3Form\fetch(), LibraryFileForm\fetch(), ManageQueryNoteFilesForm\fetch(), APIProfileForm\fetch(), UserEmailForm\fetch(), CreateReviewerForm\fetch(), UploadPluginForm\fetch(), ResolverPlugin\fetch(), EmailReviewerForm\fetch(), ReviewerGossipForm\fetch(), NavigationMenuForm\fetch(), ReviewFormForm\fetch(), SwordSettingsForm\fetch(), TextureArticleGalleyForm\fetch(), NewFileNoteForm\fetch(), AnnouncementTypeForm\fetch(), SubmissionSubmitForm\fetch(), CitationStyleLanguageSettingsForm\fetch(), ReviewFormElementForm\fetch(), NewNoteForm\fetch(), IssueGalleyForm\fetch(), SendReviewsForm\fetch(), GoogleAnalyticsSettingsForm\fetch(), PKPNavigationMenuItemsForm\fetch(), IssueForm\fetch(), EditReviewForm\fetch(), AnnouncementFeedSettingsForm\fetch(), PKPStageParticipantNotifyForm\fetch(), SubscriptionSSOSettingsForm\fetch(), PKPAssignPublicIdentifiersForm\fetch(), ArticleGalleyForm\fetch(), PKPReviewerReviewStep3Form\fetch(), ChangePasswordForm\fetch(), WebFeedSettingsForm\fetch(), PKPPublicIdentifiersForm\fetch(), AnnouncementFeedGatewayPlugin\fetch(), UsageStatsSettingsForm\fetch(), OrcidProfileSettingsForm\fetch(), WebFeedGatewayPlugin\fetch(), PKPSectionForm\fetch(), PKPSubmissionSubmitStep1Form\fetch(), StaticPageForm\fetch(), PLNSettingsForm\fetch(), ReviewFormElementResponseItemListbuilderHandler\fetch(), ReviewerReviewForm\fetch(), SubscriptionForm\fetch(), GenreForm\fetch(), RegistrationForm\fetch(), MarkupProfileSettingsForm\fetch(), ReviewReminderForm\fetch(), SubscriptionPolicyForm\fetch(), SubscriptionTypeForm\fetch(), SwordDepositPointForm\fetch(), PLNGatewayPlugin\fetch(), QueryNoteForm\fetch(), SectionForm\fetch(), URNSettingsForm\fetch(), EditorDecisionWithEmailForm\fetch(), MedraSettingsForm\fetch(), AddParticipantForm\fetch(), EditorDecisionForm\fetch(), PublicProfileForm\fetch(), PKPAuthorForm\fetch(), PKPNotificationSettingsForm\fetch(), SubmissionFilesMetadataForm\fetch(), UserGroupForm\fetch(), RecommendationForm\fetch(), Form\fetch(), CategoryForm\fetch(), MarkupSettingsForm\fetch(), QueryForm\fetch(), ListbuilderHandler\fetch(), PKPSubmissionFilesUploadBaseForm\fetch(), ReviewerForm\fetch(), UploadImageForm\fetch(), GridHandler\fetchGrid(), PKPNotificationOperationManager\fetchLinkActionNotificationContent(), AuthorDashboardReviewRoundTabHandler\fetchReviewRoundInfo(), WorkflowTabHandler\fetchTab(), AuthorDashboardTabHandler\fetchTab(), PKPWorkflowTabHandler\fetchTab(), CollapsibleGridFeature\fetchUIElements(), InfiniteScrollingFeature\fetchUIElements(), PagingFeature\fetchUIElements(), OrderItemsFeature\fetchUIElements(), PKPFileUploadWizardHandler\finishFileSubmission(), PKPNotificationOperationManager\formatToInPlaceNotification(), CitationStyleLanguagePlugin\getArticleTemplateData(), NotificationsGridCellProvider\getCellActions(), PKP\components\listPanels\PKPSubmissionsListPanel\getConfig(), PKP\Services\PKPNavigationMenuService\getDisplayStatus(), APP\Services\NavigationMenuService\getDisplayStatusCallback(), QuickSubmitForm\getIssueOptions(), PKPNotificationManager\getNotificationContents(), NavigationMenuItemsGridCellProvider\getTemplateVarsFromRowColumn(), NavigationMenusGridCellProvider\getTemplateVarsFromRowColumn(), ManualPaymentPlugin\handle(), PaypalPaymentPlugin\handle(), OrcidProfilePlugin\handleFormDisplay(), PKPToolsHandler\importexport(), IndexHandler\index(), InstallHandler\index(), LoginHandler\index(), PaymentsHandler\index(), InformationHandler\index(), AnnouncementHandler\index(), AboutContextHandler\index(), DashboardHandler\index(), ManageIssuesHandler\index(), PKPToolsHandler\index(), PKPWorkflowHandler\index(), AdminHandler\index(), SwordDepositPointsGridHandler\index(), CustomBlockForm\initData(), StaticPageForm\initData(), UploadImageForm\initData(), ManagementHandler\initialize(), AdminHandler\initialize(), InstallHandler\install(), MaintenanceForm\installError(), InstallHandler\installUpgrade(), LensGalleyPlugin\issueCallback(), PdfJsViewerPlugin\issueCallback(), IssueGridHandler\issueGalleys(), IssueGridHandler\issueToc(), UsageStatsPlugin\loadJavascript(), GatewayHandler\lockss(), LoginHandler\lostPassword(), GoogleAnalyticsPlugin\manage(), PubObjectsExportPlugin\manage(), SubscriptionSSOPlugin\manage(), CustomBlockManagerPlugin\manage(), AnnouncementFeedPlugin\manage(), MarkupPlugin\manage(), OrcidProfilePlugin\manage(), OrcidHandler\orcidVerify(), QueriesGridHandler\participants(), PaymentHandler\pay(), PaymentsHandler\payments(), PKPToolsHandler\permissions(), NavigationMenuItemHandler\preview(), AboutSiteHandler\privacy(), UsageStatsHandler\privacyInformation(), TemplateBasedFilter\process(), ProfileHandler\profile(), MarkupHandler\profile(), PKPStatsHandler\publications(), PublishHandler\publish(), QueriesGridHandler\readQuery(), AuthorReviewerGridHandler\readReview(), PKPReviewerGridHandler\readReview(), PKPAuthorDashboardHandler\readSubmissionEmail(), RegistrationHandler\register(), MarkupPlugin\register(), GoogleAnalyticsPlugin\registerScript(), GridCellProvider\render(), GridHandler\renderFilter(), GridHandler\renderGridBodyPartsInternally(), CategoryGridHandler\renderRowInternally(), GridHandler\renderRowInternally(), PKPToolsHandler\reportGenerator(), LoginHandler\requestResetPassword(), LoginHandler\resetPassword(), ReviewFormGridHandler\reviewFormElements(), PKPReviewerGridHandler\reviewHistory(), SearchHandler\search(), OpenAccessNotification\sendNotification(), MarkupSettingsTabHandler\settings(), AdminHandler\settings(), WorkflowHandler\setupIndex(), InformationHandler\setupTemplate(), PKPAuthorDashboardHandler\setupTemplate(), PKPWorkflowTabHandler\setupTemplate(), InformationCenterHandler\setupTemplate(), PKPSubmissionHandler\setupTemplate(), FileInformationCenterHandler\setupTemplate(), SearchHandler\setupTemplate(), PKPHandler\setupTemplate(), PKPReviewerHandler\showDeclineReview(), LoginHandler\signIn(), LoginHandler\signInAsUser(), PKPFileUploadWizardHandler\startWizard(), PKPToolsHandler\statistics(), PLNHandler\status(), PKPReviewerHandler\step(), PKPSubmissionHandler\step(), PKPReviewerHandler\submission(), PKPAuthorDashboardHandler\submission(), PdfJsViewerPlugin\submissionCallback(), PKPWorkflowHandler\submissionProgressBar(), AboutContextHandler\submissions(), GoogleScholarPlugin\submissionView(), PaymentsHandler\subscriptionPolicies(), AboutHandler\subscriptions(), UserHandler\subscriptions(), PaymentsHandler\subscriptions(), PaymentsHandler\subscriptionTypes(), SwordSettingsTabHandler\swordSettings(), AdminHandler\systemInfo(), PageHandler\tasks(), DashboardHandler\tasks(), OAIMetadataFormat_MARC\toXml(), OAIMetadataFormat_MARC21\toXml(), MarkupHandler\triggerConversion(), InstallHandler\upgrade(), ContextGridHandler\users(), PKPStatsHandler\users(), RegistrationHandler\validate(), BrowseBySectionHandler\view(), StaticPagesHandler\view(), AnnouncementHandler\view(), NavigationMenuItemHandler\view(), IssueHandler\view(), ArticleHandler\view(), SubmissionInformationCenterHandler\viewHistory(), FileInformationCenterHandler\viewHistory(), SubmissionInformationCenterHandler\viewInformationCenter(), InformationCenterHandler\viewInformationCenter(), FileInformationCenterHandler\viewInformationCenter(), SubmissionDocumentsFilesGridHandler\viewLibrary(), SubmissionInformationCenterHandler\viewNotes(), FileInformationCenterHandler\viewNotes(), PluginGalleryGridHandler\viewPlugin(), ManagementHandler\website(), PKPSubmissionHandler\wizard(), AdminHandler\wizard(), SettingsHandler\workflow(), and ManagementHandler\workflow().

◆ getResourcesByContext()

PKPTemplateManager::getResourcesByContext (   $resources,
  $context 
)

Get resources assigned to a context

A helper function which retrieves script, style and header assets assigned to a particular context.

Parameters
$resourcesarray Requested resources
$contextstring Requested context
Returns
array Resources assigned to these contexts

Definition at line 2085 of file PKPTemplateManager.inc.php.

References $op.

Referenced by loadHtmlGalleyStyles(), smartyLoadHeader(), smartyLoadScript(), and smartyLoadStylesheet().

◆ getState()

PKPTemplateManager::getState (   $key)

Get a piece of the state data

Parameters
string$key
Returns
mixed

Definition at line 581 of file PKPTemplateManager.inc.php.

Referenced by TemplateManager\setupBackendPage().

◆ initialize()

◆ loadHtmlGalleyStyles()

PKPTemplateManager::loadHtmlGalleyStyles (   $htmlContent,
  $embeddedFiles 
)

Inject default styles into a HTML galley

Any styles assigned to the htmlGalley context will be injected into the galley unless the galley already has an embedded CSS file.

Parameters
$htmlContentstring The HTML file content
$embeddedFilesarray Additional files embedded in this galley

Definition at line 1917 of file PKPTemplateManager.inc.php.

References getResourcesByContext().

◆ register_function()

PKPTemplateManager::register_function (   $name,
  $impl,
  $cacheable = true,
  $cache_attrs = null 
)

DEPRECATED wrapper for Smarty2 backwards compatibility

Parameters
$name
$impl
$cacheable
$cache_attrs

Definition at line 2231 of file PKPTemplateManager.inc.php.

References Config\getVar().

◆ registerJSLibrary()

PKPTemplateManager::registerJSLibrary ( )

Register all files required by the core JavaScript library

Definition at line 599 of file PKPTemplateManager.inc.php.

References addJavaScript(), AppLocale\getLocale(), and Config\getVar().

Referenced by setupBackendPage().

◆ registerJSLibraryData()

PKPTemplateManager::registerJSLibraryData ( )

Register JavaScript data used by the core JS library

This function registers script data that is required by the core JS library. This data is queued after jQuery but before the pkp-lib framework, allowing dynamic data to be passed to the framework. It is intended to be used for passing constants and locale strings, but plugins may also take advantage of a hook to include data required by their own scripts, when integrating with the pkp-lib framework.

Definition at line 682 of file PKPTemplateManager.inc.php.

References addJavaScript(), AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and Config\getVar().

Referenced by setupBackendPage().

◆ setCacheability()

PKPTemplateManager::setCacheability (   $cacheability = CACHEABILITY_PUBLIC)

Flag the page as cacheable (or not).

Parameters
$cacheabilityboolean optional

Definition at line 376 of file PKPTemplateManager.inc.php.

◆ setConstants()

PKPTemplateManager::setConstants (   $names)

Set constants to be exposed in JavaScript at pkp.const.<constant>

Parameters
array$namesArray of constant names

Definition at line 556 of file PKPTemplateManager.inc.php.

Referenced by initialize(), and setupBackendPage().

◆ setLocaleKeys()

PKPTemplateManager::setLocaleKeys (   $keys)

Set locale keys to be exposed in JavaScript at pkp.localeKeys.<key>

Parameters
array$keysArray of locale keys

Definition at line 567 of file PKPTemplateManager.inc.php.

Referenced by setupBackendPage().

◆ setState()

PKPTemplateManager::setState (   $data)

Set initial state data to be managed by the Vue.js component on this page

Parameters
array$data

Definition at line 592 of file PKPTemplateManager.inc.php.

Referenced by TemplateManager\setupBackendPage(), and setupBackendPage().

◆ setupBackendPage()

◆ smartyCallHook()

PKPTemplateManager::smartyCallHook (   $params,
  $smarty 
)

Call hooks from a template.

Definition at line 1523 of file PKPTemplateManager.inc.php.

References HookRegistry\call().

◆ smartyCompare()

PKPTemplateManager::smartyCompare (   $a,
  $b,
  $strict = false,
  $invert = false 
)

Compare the parameters.

Parameters
$amixed Parameter A
$amixed Parameter B
$strictboolean True iff a strict (===) compare should be used
$invertbooelan True iff the output should be inverted

Definition at line 1748 of file PKPTemplateManager.inc.php.

◆ smartyConcat()

PKPTemplateManager::smartyConcat ( )

Concatenate the parameters and return the result.

Definition at line 1736 of file PKPTemplateManager.inc.php.

◆ smartyCSRF()

PKPTemplateManager::smartyCSRF (   $params,
  $smarty 
)

Smarty usage: {csrf}

Custom Smarty function for inserting a CSRF token.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML

Definition at line 1857 of file PKPTemplateManager.inc.php.

◆ smartyEscape()

PKPTemplateManager::smartyEscape (   $string,
  $esc_type = 'html',
  $char_set = 'ISO-8859-1' 
)

Override the built-in smarty escape modifier to add the jqselector escaping method.

Definition at line 1771 of file PKPTemplateManager.inc.php.

◆ smartyExplode()

PKPTemplateManager::smartyExplode (   $string,
  $separator 
)

Split the supplied string by the supplied separator.

Definition at line 1763 of file PKPTemplateManager.inc.php.

◆ smartyFlush()

PKPTemplateManager::smartyFlush (   $params,
  $smarty 
)

Flush the output buffer. This is useful in cases where Smarty templates are calling functions that take a while to execute so that they can display a progress indicator or a message stating that the operation may take a while.

Definition at line 1509 of file PKPTemplateManager.inc.php.

◆ smartyHelp()

PKPTemplateManager::smartyHelp (   $params,
  $smarty 
)

Smarty usage: {help file="someFile" section="someSection" textKey="some.text.key"}

Custom Smarty function for displaying a context-sensitive help link.

Parameters
$smartySmarty
Returns
string the HTML for the generated link action

Definition at line 1377 of file PKPTemplateManager.inc.php.

References fetch().

◆ smartyHtmlOptionsTranslate()

PKPTemplateManager::smartyHtmlOptionsTranslate (   $params,
  $smarty 
)

Smarty usage: {html_options_translate ...} For parameter usage, see http://smarty.php.net/manual/en/language.function.html.options.php

Identical to Smarty's "html_options" function except option values are translated from i18n keys.

Parameters
$paramsarray
$smartySmarty

Definition at line 1410 of file PKPTemplateManager.inc.php.

◆ smartyIterate()

PKPTemplateManager::smartyIterate (   $params,
  $content,
  $smarty,
$repeat 
)

Iterator function for looping through objects extending the ItemIterator class. Parameters:

  • from: Name of template variable containing iterator
  • item: Name of template variable to receive each item
  • key: (optional) Name of variable to receive index of current item

Definition at line 1445 of file PKPTemplateManager.inc.php.

◆ smartyLoadHeader()

PKPTemplateManager::smartyLoadHeader (   $params,
  $smarty 
)

Smarty usage: {load_header context="frontent" headers=$headers}

Custom Smarty function for printing scripts attached to a context.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 1998 of file PKPTemplateManager.inc.php.

References getResourcesByContext().

◆ smartyLoadNavigationMenuArea()

PKPTemplateManager::smartyLoadNavigationMenuArea (   $params,
  $smarty 
)

Smarty usage: {load_menu name=$areaName path=$declaredMenuTemplatePath id=$id ulClass=$ulClass liClass=$liClass}

Custom Smarty function for printing navigation menu areas attached to a context.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 2026 of file PKPTemplateManager.inc.php.

References fetch(), PKPServices\get(), DAORegistry\getDAO(), PluginRegistry\getPlugins(), and PluginRegistry\loadCategory().

◆ smartyLoadScript()

PKPTemplateManager::smartyLoadScript (   $params,
  $smarty 
)

Smarty usage: {load_script context="backend" scripts=$scripts}

Custom Smarty function for printing scripts attached to a context.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 1958 of file PKPTemplateManager.inc.php.

References DAORegistry\getDAO(), and getResourcesByContext().

◆ smartyLoadStylesheet()

PKPTemplateManager::smartyLoadStylesheet (   $params,
  $smarty 
)

Smarty usage: {load_stylesheet context="frontend" stylesheets=$stylesheets}

Custom Smarty function for printing stylesheets attached to a context.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 1876 of file PKPTemplateManager.inc.php.

References DAORegistry\getDAO(), and getResourcesByContext().

◆ smartyLoadUrlInDiv()

PKPTemplateManager::smartyLoadUrlInDiv (   $params,
  $smarty 
)

Smarty usage: {load_url_in_div id="someHtmlId" url="http://the.url.to.be.loaded.into.the.grid"}

Custom Smarty function for loading a URL via AJAX into a DIV. Convenience wrapper for smartyLoadUrlInEl.

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 1844 of file PKPTemplateManager.inc.php.

References smartyLoadUrlInEl().

◆ smartyLoadUrlInEl()

PKPTemplateManager::smartyLoadUrlInEl (   $params,
  $smarty 
)

Smarty usage: {load_url_in_el el="htmlElement" id="someHtmlId" url="http://the.url.to.be.loaded.into.the.grid"}

Custom Smarty function for loading a URL via AJAX into any HTML element

Parameters
$paramsarray associative array
$smartySmarty
Returns
string of HTML/Javascript

Definition at line 1803 of file PKPTemplateManager.inc.php.

References fetch().

Referenced by fetchAjax(), and smartyLoadUrlInDiv().

◆ smartyNullLinkAction()

PKPTemplateManager::smartyNullLinkAction (   $params,
  $smarty 
)

Smarty usage: {null_link_action id="linkId" key="localization.key.name" image="imageClassName"}

Custom Smarty function for displaying a null link action; these will typically be attached and handled in Javascript.

Parameters
$smartySmarty
Returns
string the HTML for the generated link action

Definition at line 1350 of file PKPTemplateManager.inc.php.

References fetch().

◆ smartyPageInfo()

PKPTemplateManager::smartyPageInfo (   $params,
  $smarty 
)

Display page information for a listing of items that has been divided onto multiple pages. Usage: {page_info from=$myIterator}

Definition at line 1478 of file PKPTemplateManager.inc.php.

◆ smartyPageLinks()

PKPTemplateManager::smartyPageLinks (   $params,
  $smarty 
)

Display page links for a listing of items that has been divided onto multiple pages. Usage: {page_links name="nameMustMatchGetRangeInfoCall" iterator=$myIterator additional_param=myAdditionalParameterValue }

Definition at line 1658 of file PKPTemplateManager.inc.php.

◆ smartyPluckFiles()

PKPTemplateManager::smartyPluckFiles (   $params,
  $smarty 
)

Smarty usage: {pluck_files files=$availableFiles by="chapter" value=$chapterId}

Custom Smarty function for plucking files from the array of $availableFiles related to a submission. Intended to be used on the frontend

Parameters
$paramsarray associative array
$smartySmarty
Returns
array of SubmissionFile objects

Definition at line 2126 of file PKPTemplateManager.inc.php.

References DAORegistry\getDAO().

◆ smartyStrtotime()

PKPTemplateManager::smartyStrtotime (   $string)

Convert a string to a numeric time.

Definition at line 1756 of file PKPTemplateManager.inc.php.

◆ smartyTitle()

PKPTemplateManager::smartyTitle (   $parameters,
  $smarty 
)

Generate the <title> tag for a page

Usage: {title value="Journal Settings"}

Parameters
$parametersarray
$smartyobject Available parameters:
  • router: which router to use
  • context
  • page
  • component
  • op
  • path (array)
  • anchor
  • escape (default to true unless otherwise specified)
  • params: parameters to include in the URL if available as an array

Definition at line 1631 of file PKPTemplateManager.inc.php.

◆ smartyToArray()

PKPTemplateManager::smartyToArray ( )

Convert the parameters of a function to an array.

Definition at line 1729 of file PKPTemplateManager.inc.php.

◆ smartyTranslate()

PKPTemplateManager::smartyTranslate (   $params,
  $smarty 
)

Smarty usage: {translate key="localization.key.name" [paramName="paramValue" ...]}

Custom Smarty function for translating localization keys. Substitution works by replacing tokens like "{$foo}" with the value of the parameter named "foo" (if supplied).

Parameters
$paramsarray associative array, must contain "key" parameter for string to translate plus zero or more named parameters for substitution. Translation variables can be specified also as an optional associative array named "params".
$smartySmarty
Returns
string the localized string, including any parameter substitutions

Definition at line 1327 of file PKPTemplateManager.inc.php.

◆ smartyUrl()

PKPTemplateManager::smartyUrl (   $parameters,
  $smarty 
)

Generate a URL into a PKPApp.

Parameters
$paramsarray
$smartyobject Available parameters:
  • router: which router to use
  • context
  • page
  • component
  • op
  • path (array)
  • anchor
  • escape (default to true unless otherwise specified)
  • params: parameters to include in the URL if available as an array

Definition at line 1544 of file PKPTemplateManager.inc.php.

References $application, $op, and PKPApplication\get().


The documentation for this class was generated from the following file: