Open Journal Systems  3.3.0
PKP\Services\PKPSiteService Class Reference
Inheritance diagram for PKP\Services\PKPSiteService:

Public Member Functions

 edit ($site, $params, $request)
 
 getFullProperties ($site, $args=null)
 
 getProperties ($site, $props, $args=null)
 
 getSummaryProperties ($site, $args=null)
 
 moveTemporaryFile ($context, $temporaryFile, $fileNameBase, $userId, $localeKey='')
 
 validate ($props, $allowedLocales, $primaryLocale)
 

Protected Member Functions

 _saveFileParam ($site, $value, $settingName, $userId, $localeKey='', $isImage=false)
 

Detailed Description

Definition at line 22 of file PKPSiteService.inc.php.

Member Function Documentation

◆ _saveFileParam()

PKP\Services\PKPSiteService::_saveFileParam (   $site,
  $value,
  $settingName,
  $userId,
  $localeKey = '',
  $isImage = false 
)
protected

Handle a site setting for an uploaded file

  • Moves the temporary file to the public directory
  • Resets the param value to what is expected to be stored in the db

This method is protected because all operations which edit the site should go through the editSite method in order to ensure that the appropriate hooks are fired.

Parameters
$siteSite The site being edited
$valuemixed The param value to be saved. Contains the temporary file ID if a new file has been uploaded.
$settingNamestring The name of the setting to save, typically used in the filename.
$userIdinteger ID of the user who owns the temporary file
$localeKeystring Optional. Used in the filename for multilingual properties.
$isImageboolean Optional. For image files which return alt text, width, height, etc in the param value.
Returns
string|array|null New param value or null on failure

Definition at line 261 of file PKPSiteService.inc.php.

References Core\getCurrentDate().

◆ edit()

PKP\Services\PKPSiteService::edit (   $site,
  $params,
  $request 
)

Edit the site

This does not check if the user is authorized to edit the site, or validate or sanitize the new content.

Parameters
$siteContext The context to edit
$paramsArray Key/value array of new data
$requestRequest
Returns
Site

Definition at line 173 of file PKPSiteService.inc.php.

References HookRegistry\call(), and DAORegistry\getDAO().

◆ getFullProperties()

PKP\Services\PKPSiteService::getFullProperties (   $site,
  $args = null 
)

◆ getProperties()

PKP\Services\PKPSiteService::getProperties (   $site,
  $props,
  $args = null 
)

◆ getSummaryProperties()

PKP\Services\PKPSiteService::getSummaryProperties (   $site,
  $args = null 
)

◆ moveTemporaryFile()

PKP\Services\PKPSiteService::moveTemporaryFile (   $context,
  $temporaryFile,
  $fileNameBase,
  $userId,
  $localeKey = '' 
)

Move a temporary file to the site's public directory

Parameters
$contextContext
$temporaryFileTemporaryFile
$fileNameBasestring Unique identifier to use for the filename. The Extension and locale will be appended.
$userIdint ID of the user who uploaded the temporary file
$localeKeystring Example: en_US. Leave empty for a file that is not localized.
Returns
string|boolean The new filename or false on failure

Definition at line 214 of file PKPSiteService.inc.php.

◆ validate()

PKP\Services\PKPSiteService::validate (   $props,
  $allowedLocales,
  $primaryLocale 
)

Validate the properties of a site

Passes the properties through the SchemaService to validate them, and performs any additional checks needed to validate a site.

This does NOT authenticate the current user to perform the action.

Parameters
$propsarray The data to validate
$allowedLocalesarray Which locales are allowed for this context
$primaryLocalestring
Returns
array List of error messages. The array keys are property names

Definition at line 75 of file PKPSiteService.inc.php.

References ValidatorFactory\allowedLocales(), PKPServices\get(), PKPApplication\get(), ValidatorFactory\make(), AppLocale\requireComponents(), ValidatorFactory\required(), PKP\Services\SCHEMA_PUBLICATION, PKP\Services\SCHEMA_SITE, and ValidatorFactory\temporaryFilesExist().


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