mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 03:34:33 +02:00
Bump version to 3.0.232
This commit is contained in:
@@ -79,7 +79,7 @@ class ProcessWire extends Wire {
|
|||||||
* Reversion revision number
|
* Reversion revision number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const versionRevision = 231;
|
const versionRevision = 232;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version suffix string (when applicable)
|
* Version suffix string (when applicable)
|
||||||
|
@@ -6,6 +6,10 @@
|
|||||||
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
|
* #pw-summary Provides a version control API for pages in ProcessWire.
|
||||||
|
* #pw-var $pagesVersions
|
||||||
|
*
|
||||||
|
* #pw-body =
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
* // Note: API provided by $pagesVersions API variable
|
* // Note: API provided by $pagesVersions API variable
|
||||||
* // present with PagesVersions module is installed.
|
* // present with PagesVersions module is installed.
|
||||||
@@ -29,11 +33,12 @@
|
|||||||
* // Delete page version
|
* // Delete page version
|
||||||
* $pagesVersions->deletePageVersion($pageV2);
|
* $pagesVersions->deletePageVersion($pageV2);
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
|
* #pw-body
|
||||||
*
|
*
|
||||||
* HOOKABLE METHODS
|
* HOOKABLE METHODS
|
||||||
* ----------------
|
* ----------------
|
||||||
* @method bool allowPageVersions(Page $page)
|
* @method bool allowPageVersions(Page $page)
|
||||||
* @method bool useTempVersionToRestore(Page $page)
|
* @method bool useTempVersionToRestore(Page $page) #pw-internal
|
||||||
*
|
*
|
||||||
* @todo test change of template in version
|
* @todo test change of template in version
|
||||||
*
|
*
|
||||||
@@ -43,13 +48,15 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Module information
|
* Module information
|
||||||
*
|
*
|
||||||
|
* #pw-internal
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getModuleInfo() {
|
public static function getModuleInfo() {
|
||||||
return [
|
return [
|
||||||
'title' => 'Pages Versions',
|
'title' => 'Pages Versions',
|
||||||
'summary' => 'Version control API for pages',
|
'summary' => 'Provides a version control API for pages in ProcessWire.',
|
||||||
'version' => 1,
|
'version' => 1,
|
||||||
'icon' => self::iconName,
|
'icon' => self::iconName,
|
||||||
'autoload' => true,
|
'autoload' => true,
|
||||||
@@ -75,6 +82,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* $pageV2 = $pagesVersions->getPageVersion($page, 2);
|
* $pageV2 = $pagesVersions->getPageVersion($page, 2);
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page Page that version is for
|
* @param Page $page Page that version is for
|
||||||
* @param int $version Version number to get
|
* @param int $version Version number to get
|
||||||
* @return Page|NullPage
|
* @return Page|NullPage
|
||||||
@@ -99,6 +108,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* This is similar to the `getPageVersion()` method except that it populates
|
* This is similar to the `getPageVersion()` method except that it populates
|
||||||
* the given `$page` rather than populating and returning a cloned copy of it.
|
* the given `$page` rather than populating and returning a cloned copy of it.
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param int|string|PageVersionInfo $version
|
* @param int|string|PageVersionInfo $version
|
||||||
* @param array $options
|
* @param array $options
|
||||||
@@ -194,6 +205,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* }
|
* }
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param array $options
|
* @param array $options
|
||||||
* - `getInfo`: Specify true to instead get PageVersionInfo objects (default=false)
|
* - `getInfo`: Specify true to instead get PageVersionInfo objects (default=false)
|
||||||
@@ -283,6 +296,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* }
|
* }
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param array $options
|
* @param array $options
|
||||||
* - `sort`: Sort by property, one of: 'created', '-created', 'version', '-version' (default='-created')
|
* - `sort`: Sort by property, one of: 'created', '-created', 'version', '-version' (default='-created')
|
||||||
@@ -297,6 +312,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Get all pages that have 1 or more versions available
|
* Get all pages that have 1 or more versions available
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @return PageArray
|
* @return PageArray
|
||||||
* @throws WireException
|
* @throws WireException
|
||||||
*
|
*
|
||||||
@@ -317,6 +334,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Does page have the given version?
|
* Does page have the given version?
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param int|string|PageVersionInfo $version Version number or omit to return quantity of versions
|
* @param int|string|PageVersionInfo $version Version number or omit to return quantity of versions
|
||||||
* @return bool|int
|
* @return bool|int
|
||||||
@@ -355,6 +374,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* This is the same as calling the `hasPageVersion()` method
|
* This is the same as calling the `hasPageVersion()` method
|
||||||
* with $version argument omitted.
|
* with $version argument omitted.
|
||||||
*
|
*
|
||||||
|
* #pw-group-getting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
@@ -380,6 +401,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* echo "Added version $version for page $page";
|
* echo "Added version $version for page $page";
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-saving
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param array $options
|
* @param array $options
|
||||||
* - `description` (string) Optional text description for version
|
* - `description` (string) Optional text description for version
|
||||||
@@ -424,6 +447,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Save a page version
|
* Save a page version
|
||||||
*
|
*
|
||||||
|
* #pw-group-saving
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param int|PageVersionInfo $version Version number or PageVersionInfo
|
* @param int|PageVersionInfo $version Version number or PageVersionInfo
|
||||||
* - If given version number is greater than 0 and version doesn't exist, it will be added.
|
* - If given version number is greater than 0 and version doesn't exist, it will be added.
|
||||||
@@ -542,6 +567,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* $pagesVersions->deletePageVersion($pageV2);
|
* $pagesVersions->deletePageVersion($pageV2);
|
||||||
* ~~~~~~
|
* ~~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-deleting
|
||||||
|
*
|
||||||
* @param Page $page Page to delete version from, or page having the version you want to delete.
|
* @param Page $page Page to delete version from, or page having the version you want to delete.
|
||||||
* @param int $version Version number to delete or omit if given $page is the version you want to delete.
|
* @param int $version Version number to delete or omit if given $page is the version you want to delete.
|
||||||
* @return int Number of DB rows deleted as part of the deletion process
|
* @return int Number of DB rows deleted as part of the deletion process
|
||||||
@@ -583,6 +610,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Delete all versions for given page
|
* Delete all versions for given page
|
||||||
*
|
*
|
||||||
|
* #pw-group-deleting
|
||||||
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @return int Number of versions deleted
|
* @return int Number of versions deleted
|
||||||
*
|
*
|
||||||
@@ -599,6 +628,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Delete all versions across all pages
|
* Delete all versions across all pages
|
||||||
*
|
*
|
||||||
|
* #pw-group-deleting
|
||||||
|
*
|
||||||
* @param bool $areYouSure Specify true to indicate you are sure you want to do this
|
* @param bool $areYouSure Specify true to indicate you are sure you want to do this
|
||||||
* @return int Quantity of versions deleted
|
* @return int Quantity of versions deleted
|
||||||
*
|
*
|
||||||
@@ -633,6 +664,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* $pagesVersions->restore($pageV2);
|
* $pagesVersions->restore($pageV2);
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
|
* #pw-group-saving
|
||||||
|
*
|
||||||
* @param Page $page Page to restore version to or a page that was loaded as a version.
|
* @param Page $page Page to restore version to or a page that was loaded as a version.
|
||||||
* @param int $version Version number to restore. Can be omitted if given $page is already a version.
|
* @param int $version Version number to restore. Can be omitted if given $page is already a version.
|
||||||
* @param array $options
|
* @param array $options
|
||||||
@@ -1028,7 +1061,7 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Get the version number of given page or 0 if not versioned
|
* Get the version number of given page or 0 if not versioned
|
||||||
*
|
*
|
||||||
* #pw-internal
|
* #pw-group-utility
|
||||||
*
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @param int|string|PageVersionInfo Optional version argument to use, if omitted it pulls from $page
|
* @param int|string|PageVersionInfo Optional version argument to use, if omitted it pulls from $page
|
||||||
@@ -1094,6 +1127,8 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Get fields where versions are not supported
|
* Get fields where versions are not supported
|
||||||
*
|
*
|
||||||
|
* #pw-group-utility
|
||||||
|
*
|
||||||
* @param Page|null $page Page to limit check to or omit for all fields
|
* @param Page|null $page Page to limit check to or omit for all fields
|
||||||
* @return Field[] Returned array of Field objects is indexed by Field name
|
* @return Field[] Returned array of Field objects is indexed by Field name
|
||||||
*
|
*
|
||||||
@@ -1149,6 +1184,7 @@ class PagesVersions extends Wire implements Module {
|
|||||||
* Is given page allowed to have versions?
|
* Is given page allowed to have versions?
|
||||||
*
|
*
|
||||||
* #pw-hooker
|
* #pw-hooker
|
||||||
|
* #pw-group-utility
|
||||||
*
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -1163,7 +1199,7 @@ class PagesVersions extends Wire implements Module {
|
|||||||
/**
|
/**
|
||||||
* Get next available version number for given page
|
* Get next available version number for given page
|
||||||
*
|
*
|
||||||
* #pw-internal
|
* #pw-group-utility
|
||||||
*
|
*
|
||||||
* @param Page $page
|
* @param Page $page
|
||||||
* @return int
|
* @return int
|
||||||
@@ -1200,7 +1236,6 @@ class PagesVersions extends Wire implements Module {
|
|||||||
return $fieldtype->versions()->hasNestedRepeaterFields($page);
|
return $fieldtype->versions()->hasNestedRepeaterFields($page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* HOOKS
|
* HOOKS
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user