Open Monograph Press
3.3.0
|
Static Public Member Functions | |
static | call ($hookName, $args=null) |
static | clear ($hookName) |
static & | getCalledHooks () |
static & | getHooks ($hookName=null) |
static | register ($hookName, $callback, $hookSequence=HOOK_SEQUENCE_NORMAL) |
static | rememberCalledHooks ($askOnly=false, $updateTo=true) |
static | resetCalledHooks ($leaveAlive=false) |
static | setHooks ($hookName, $callbacks) |
Class for linking core functionality with plugins.
Definition at line 21 of file HookRegistry.inc.php.
|
static |
Call each callback registered against $hookName in sequence. The first callback that returns a value that evaluates to true will interrupt processing and this function will return its return value; otherwise, all callbacks will be called in sequence and the return value of this call will be the value returned by the last callback.
$hookName | string The name of the hook to register against |
$args | string Hooks are called with this as the second param |
Definition at line 86 of file HookRegistry.inc.php.
References getCalledHooks(), and getHooks().
Referenced by DAO\__construct(), LinkAction\__construct(), Form\__construct(), Installer\__construct(), SitemapHandler\_createContextSitemap(), ReviewFormElementDAO\_fromRow(), ReviewFormDAO\_fromRow(), IdentificationCodeDAO\_fromRow(), MarketDAO\_fromRow(), SeriesDAO\_fromRow(), PublicationDateDAO\_fromRow(), RepresentativeDAO\_fromRow(), ReviewerSubmissionDAO\_fromRow(), QueryDAO\_fromRow(), SalesRightsDAO\_fromRow(), SubmissionCommentDAO\_fromRow(), ChapterDAO\_fromRow(), LibraryFileDAO\_fromRow(), CategoryDAO\_fromRow(), NoteDAO\_fromRow(), CodelistItemDAO\_fromRow(), GenreDAO\_fromRow(), ONIXCodelistItemDAO\_fromRow(), PublicationFormatDAO\_fromRow(), NotificationDAO\_fromRow(), PKPTemplateResource\_getFilename(), PKP\Services\QueryBuilders\PKPStatsQueryBuilder\_getObject(), PKP\Services\QueryBuilders\PKPStatsEditorialQueryBuilder\_getObject(), PKPAcronPlugin\_parseCrontab(), AccessKeyDAO\_returnAccessKeyFromRow(), UserGroupDAO\_returnFromRow(), PKPOAIDAO\_returnIdentifierFromRow(), PKPOAIDAO\_returnRecordFromRow(), ReviewFormResponseDAO\_returnReviewFormResponseFromRow(), TemporaryFileDAO\_returnTemporaryFileFromRow(), VersionDAO\_returnVersionFromRow(), PKP\Services\PKPAnnouncementService\add(), PKP\Services\PKPAuthorService\add(), PKP\Services\PKPEmailTemplateService\add(), PKP\Services\PKPContextService\add(), PKP\Services\PKPPublicationService\add(), PKP\Services\PKPSubmissionService\add(), EditorAction\addReviewer(), CatalogBookHandler\book(), EventLogDAO\build(), EmailLogDAO\build(), PKPTemplateManager\compileLess(), ReviewerAction\confirmReview(), SubmissionFileManager\copyFileToFileStage(), PageHandler\css(), PKP\Services\PKPAnnouncementService\delete(), PKP\Services\PKPAuthorService\delete(), PKP\Services\PKPEmailTemplateService\delete(), PKP\Services\PKPContextService\delete(), PKP\Services\PKPPublicationService\delete(), PKP\Services\PKPSubmissionService\delete(), FileManager\deleteByPath(), Installer\destroy(), Dispatcher\dispatch(), PKPTemplateManager\display(), CatalogBookHandler\download(), FileManager\downloadByPath(), HtmlMonographFilePlugin\downloadCallback(), PKP\Services\PKPSiteService\edit(), PKP\Services\PKPAnnouncementService\edit(), PKP\Services\PKPAuthorService\edit(), PKP\Services\PKPEmailTemplateService\edit(), PKP\Services\PKPContextService\edit(), PKP\Services\PKPPublicationService\edit(), PKP\Services\PKPSubmissionService\edit(), UnassignReviewerForm\execute(), ReinstateReviewerForm\execute(), ThankReviewerForm\execute(), Form\execute(), Filter\execute(), Installer\executeInstaller(), Form\fetch(), PKPTemplateManager\fetch(), PKP\Services\PKPSchemaService\get(), PKPStatsUserHandler\get(), PKPStatsEditorialHandler\get(), PKPStatsPublicationHandler\get(), PKPStatsPublicationHandler\getAbstract(), DAO\getAdditionalFieldNames(), PKPStatsEditorialHandler\getAverages(), PKP\Services\PKPStatsEditorialService\getAverages(), PKP\Services\PKPSubmissionService\getBackendListProperties(), PKPRequest\getBasePath(), PKPRequest\getBaseUrl(), PluginRegistry\getCategories(), PKPRequest\getCompleteUrl(), PKP\components\forms\FormComponent\getConfig(), PKP\Services\QueryBuilders\PKPEmailTemplateQueryBuilder\getCustom(), PKP\Services\QueryBuilders\PKPEmailTemplateQueryBuilder\getDefault(), PKP\Services\PKPNavigationMenuService\getDisplayStatus(), PKP\Services\PKPUserService\getFullProperties(), PKPStatsPublicationHandler\getGalley(), PKPRequest\getIndexUrl(), PKPRouter\getIndexUrl(), Form\getLocaleFieldNames(), DAO\getLocaleFieldNames(), PKPVocabHandler\getMany(), PKPUserHandler\getMany(), PKPBackendSubmissionsHandler\getMany(), PKPEmailTemplateHandler\getMany(), PKPContextHandler\getMany(), PKPStatsPublicationHandler\getMany(), PKPAnnouncementHandler\getMany(), PKPSubmissionHandler\getMany(), PKPStatsPublicationHandler\getManyAbstract(), PKPStatsPublicationHandler\getManyGalley(), PKP\Services\PKPNavigationMenuService\getMenuItemCustomEditTemplates(), PKP\Services\PKPNavigationMenuService\getMenuItemTypes(), PKPNotificationSettingsForm\getNotificationSettingCategories(), PKPNotificationSettingsForm\getNotificationSettingsMap(), PKP\Services\PKPStatsService\getOrderedObjects(), PKP\Services\PKPStatsEditorialService\getOverview(), PKP\Services\PKPSiteService\getProperties(), PKP\Services\PKPAnnouncementService\getProperties(), PKP\Services\PKPAuthorService\getProperties(), PKP\Services\PKPPublicationService\getProperties(), PKP\Services\PKPEmailTemplateService\getProperties(), PKP\Services\PKPContextService\getProperties(), PKP\Services\PKPSubmissionService\getProperties(), PKP\Services\PKPUserService\getProperties(), PKPRequest\getProtocol(), PKP\Services\QueryBuilders\PKPAnnouncementQueryBuilder\getQuery(), PKP\Services\QueryBuilders\PKPPublicationQueryBuilder\getQuery(), PKP\Services\QueryBuilders\PKPAuthorQueryBuilder\getQuery(), PKP\Services\QueryBuilders\PKPContextQueryBuilder\getQuery(), PKP\Services\QueryBuilders\PKPSubmissionQueryBuilder\getQuery(), PKP\Services\QueryBuilders\PKPUserQueryBuilder\getQuery(), PKP\Services\PKPAnnouncementService\getQueryBuilder(), PKP\Services\PKPAuthorService\getQueryBuilder(), PKP\Services\PKPPublicationService\getQueryBuilder(), PKP\Services\PKPUserService\getQueryBuilder(), PKP\Services\PKPEmailTemplateService\getQueryBuilder(), PKP\Services\PKPSubmissionService\getQueryBuilder(), PKP\Services\PKPContextService\getQueryBuilder(), PKP\Services\PKPStatsService\getQueryBuilder(), PKP\Services\PKPStatsEditorialService\getQueryBuilder(), PKPRequest\getQueryString(), PKP\Services\PKPStatsService\getRecords(), PKPRequest\getRemoteAddr(), PKPRequest\getRemoteDomain(), PKPRouter\getRequestedContextPaths(), Request\getRequestedPressPath(), PKPRequest\getRequestPath(), PKPRequest\getRequestUrl(), MonographSearch\getResultSetOrderingOptions(), PKPUserHandler\getReviewers(), PKP\Services\PKPUserService\getReviewersQueryBuilder(), PKP\Services\PKPUserService\getReviewerSummaryProperties(), PKPComponentRouter\getRpcServiceEndpoint(), PKPRequest\getServerHost(), OAIDAO\getSets(), PKPEditorDecisionActionsManager\getStageDecisions(), PKP\Services\PKPUserService\getSummaryProperties(), PKP\Services\PKPStatsService\getTimeline(), PKPUsageEventPlugin\getUsageEvent(), PKPRequest\getUserAgent(), PressOAI\identifiers(), Form\initData(), GridHandler\initFeatures(), PublicationFormatTombstoneManager\insertTombstoneByPublicationFormat(), PKPLocale\installLocale(), PluginRegistry\loadCategory(), PKPUserAction\mergeUsers(), OAI\metadataFormats(), Installer\parseInstaller(), Installer\postInstall(), Installer\preInstall(), PKP\Services\PKPPublicationService\publish(), Form\readUserVars(), EditorAction\recordDecision(), PressOAI\records(), PKPRequest\redirectUrl(), PKPLocale\registerLocaleFile(), PKP\Services\PKPEmailTemplateService\restoreDefaults(), PKP\Services\PKPContextService\restoreLocaleDefaults(), DAO\retrieve(), DAO\retrieveCached(), DAO\retrieveLimit(), DAO\retrieveRange(), SubmissionSearch\retrieveResults(), PKPPageRouter\route(), PKPSubmissionHandler\saveStep(), Mail\send(), EditorAction\setDueDates(), PressOAI\sets(), PKPTemplateManager\setupBackendPage(), APIHandler\setupEndpoints(), PKPTemplateManager\smartyCallHook(), MonographSearchIndex\submissionChangesFinished(), PKPLocale\translate(), PKP\Services\PKPPublicationService\unpublish(), DAO\update(), PKP\Services\PKPSubmissionService\updateStatus(), Installer\updateVersion(), PKPUploadPublicFileHandler\uploadFile(), PKP\Services\PKPAnnouncementService\validate(), PKP\Services\PKPEmailTemplateService\validate(), Form\validate(), PKP\Services\PKPPublicationService\validatePublish(), and PKP\Services\PKPPublicationService\version().
|
static |
Clear hooks registered against the given name.
$hookName | string Name of hook |
Definition at line 58 of file HookRegistry.inc.php.
References getHooks().
Referenced by PKPRequestTest\testRedirectUrl().
|
static |
Return a reference to the stored hooks.
Definition at line 153 of file HookRegistry.inc.php.
Referenced by call(), resetCalledHooks(), PKPRequestTest\testGetBasePath(), PKPRequestTest\testGetBaseUrl(), PKPRouterTestCase\testGetIndexUrl(), PKPRequestTest\testGetProtocolNoHttpsVariable(), PKPRouterTestCase\testGetRequestedContextPathWithFullContextParameters(), PKPRouterTestCase\testGetRequestedContextPathWithFullPathInfo(), PKPRequestTest\testGetRequestPath(), and PKPRequestTest\testRedirectUrl().
|
static |
Get the current set of hook registrations.
$hookName | string Name of hook to optionally return |
Definition at line 28 of file HookRegistry.inc.php.
References Registry\get().
Referenced by call(), PKPAcronPlugin\callbackManage(), clear(), PageHandler\css(), PKPUsageEventPlugin\getUsageEvent(), register(), and setHooks().
|
static |
Register a hook against the given hook name.
$hookName | string Name of hook to register against |
$callback | object Callback pseudotype |
$hookSequence | int Optional hook sequence specifier HOOK_SEQUENCE_... |
Definition at line 70 of file HookRegistry.inc.php.
References getHooks().
Referenced by StatsHandler\__construct(), BackendSubmissionsHandler\__construct(), APP\Services\SubmissionService\__construct(), APP\Services\ContextService\__construct(), APP\Services\PublicationService\__construct(), APP\Services\NavigationMenuService\__construct(), UsageStatsPlugin\displayReaderStatistics(), PKPTemplateManager\initialize(), PlagiarismPlugin\register(), CustomLocalePlugin\register(), TinyMCEPlugin\register(), GoogleScholarPlugin\register(), HtmlMonographFilePlugin\register(), DublinCoreMetaPlugin\register(), GoogleAnalyticsPlugin\register(), PdfJsViewerPlugin\register(), PiwikPlugin\register(), URNPubIdPlugin\register(), DOIPubIdPlugin\register(), OAIMetadataFormatPlugin\register(), PKPPubIdPlugin\register(), PKPUsageEventPlugin\register(), CustomBlockManagerPlugin\register(), WebFeedPlugin\register(), PKPAcronPlugin\register(), ManualPaymentPlugin\register(), PaypalPaymentPlugin\register(), StaticPagesPlugin\register(), ThemePlugin\register(), Plugin\register(), UsageStatsPlugin\register(), SmithsonianThemePlugin\SmithsonianThemePlugin(), and PKPRequestTest\testRedirectUrl().
|
static |
Set/query the flag that triggers storing of called hooks.
$askOnly | boolean When set to true, the flag will not be changed but only returned. |
$updateTo | boolean When $askOnly is set to 'true' then this parameter defines the value of the flag. |
Definition at line 128 of file HookRegistry.inc.php.
Referenced by resetCalledHooks(), PKPRequestTest\setUp(), and PKPRouterTestCase\setUp().
|
static |
Switch off the function to store hooks and delete all stored hooks. Always call this after using otherwise we get a severe memory.
$leaveAlive | boolean Set this to true if you only want to delete hooks stored so far but if you want to record future hook calls, too. |
Definition at line 143 of file HookRegistry.inc.php.
References getCalledHooks(), and rememberCalledHooks().
Referenced by PKPRequestTest\tearDown(), PKPRouterTestCase\tearDown(), PKPRequestTest\testGetBasePath(), PKPRequestTest\testGetBaseUrl(), PKPRouterTestCase\testGetIndexUrl(), PKPRequestTest\testGetProtocolNoHttpsVariable(), PKPRouterTestCase\testGetRequestedContextPathWithFullContextParameters(), PKPRouterTestCase\testGetRequestedContextPathWithFullPathInfo(), and PKPRequestTest\testGetRequestPath().
|
static |
Set the hooks table for the given hook name to the supplied array of callbacks.
$hookName | string Name of hook to set |
$callbacks | array Array of callbacks for this hook |
Definition at line 49 of file HookRegistry.inc.php.
References getHooks().