Better document admin tasks

This commit is contained in:
Matias Griese
2021-04-14 13:40:02 +03:00
parent ccd68d2ca9
commit 9383007b93

View File

@@ -76,6 +76,8 @@ class AdminController extends AdminBaseController
/** /**
* Keep alive * Keep alive
* *
* Route: POST /task:keepAlive (AJAX call)
*
* @return void * @return void
*/ */
protected function taskKeepAlive(): void protected function taskKeepAlive(): void
@@ -89,6 +91,8 @@ class AdminController extends AdminBaseController
/** /**
* Clear the cache. * Clear the cache.
* *
* Route: GET /cache.json/task:clearCache (AJAX call)
*
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
protected function taskClearCache() protected function taskClearCache()
@@ -133,6 +137,10 @@ class AdminController extends AdminBaseController
/** /**
* Handles form and saves the input data if its valid. * Handles form and saves the input data if its valid.
* *
* Route: POST /pages?task:save
* Route: POST /user?task:save
* Route: POST /*?task:save
*
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
public function taskSave() public function taskSave()
@@ -203,6 +211,9 @@ class AdminController extends AdminBaseController
/** /**
* Handle logout. * Handle logout.
* *
* Route: GET /task:logout
* Route: POST ?task=logout
*
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
protected function taskLogout() protected function taskLogout()
@@ -215,6 +226,8 @@ class AdminController extends AdminBaseController
} }
/** /**
* Route: POST /ajax.json/task:regenerate2FASecret (AJAX call)
*
* @return bool * @return bool
*/ */
public function taskRegenerate2FASecret() public function taskRegenerate2FASecret()
@@ -333,6 +346,8 @@ class AdminController extends AdminBaseController
/** /**
* Get Notifications * Get Notifications
* *
* Route: POST /task:getNotifications (AJAX call)
*
* @return never-return * @return never-return
*/ */
protected function taskGetNotifications(): void protected function taskGetNotifications(): void
@@ -376,6 +391,8 @@ class AdminController extends AdminBaseController
/** /**
* Hide notifications. * Hide notifications.
* *
* Route: POST /notifications.json/task:hideNotification/notification_id:ID (AJAX call)
*
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
protected function taskHideNotification() protected function taskHideNotification()
@@ -412,6 +429,8 @@ class AdminController extends AdminBaseController
/** /**
* Get Newsfeeds * Get Newsfeeds
* *
* Route: POST /ajax.json/task:getNewsFeed (AJAX call)
*
* @return never-return * @return never-return
*/ */
protected function taskGetNewsFeed(): void protected function taskGetNewsFeed(): void
@@ -446,6 +465,8 @@ class AdminController extends AdminBaseController
/** /**
* Handle the backup action * Handle the backup action
* *
* Route: GET /backup.json/id:BACKUP_ID/task:backup (AJAX call)
*
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
protected function taskBackup() protected function taskBackup()
@@ -504,6 +525,8 @@ class AdminController extends AdminBaseController
/** /**
* Handle delete backup action * Handle delete backup action
* *
* Route: GET /backup.json/backup:BACKUP_FILE/task:backupDelete (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskBackupDelete() protected function taskBackupDelete()
@@ -546,7 +569,7 @@ class AdminController extends AdminBaseController
/** /**
* Enable a plugin. * Enable a plugin.
* *
* Route: /plugins * Route: GET /plugins/SLUG/task:enable
* *
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
@@ -576,7 +599,7 @@ class AdminController extends AdminBaseController
/** /**
* Disable a plugin. * Disable a plugin.
* *
* Route: /plugins * Route: GET /plugins/SLUG/task:disable
* *
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
@@ -606,7 +629,7 @@ class AdminController extends AdminBaseController
/** /**
* Set the default theme. * Set the default theme.
* *
* Route: /themes * Route: GET /themes/SLUG/task:activate
* *
* @return bool True if the action was performed. * @return bool True if the action was performed.
*/ */
@@ -650,6 +673,8 @@ class AdminController extends AdminBaseController
/** /**
* Handles updating Grav * Handles updating Grav
* *
* Route: GET /update.json/task:updategrav (AJAX call)
*
* @return bool False if user has no permissions. * @return bool False if user has no permissions.
*/ */
public function taskUpdategrav() public function taskUpdategrav()
@@ -684,12 +709,8 @@ class AdminController extends AdminBaseController
/** /**
* Handles uninstalling plugins and themes * Handles uninstalling plugins and themes
* *
* Route: /plugins
* Route: /themes
*
* @deprecated
*
* @return bool True if the action was performed * @return bool True if the action was performed
* @deprecated Not being used anymore
*/ */
public function taskUninstall() public function taskUninstall()
{ {
@@ -720,6 +741,8 @@ class AdminController extends AdminBaseController
/** /**
* Toggle the gpm.releases setting * Toggle the gpm.releases setting
* *
* Route: POST /ajax.json/task:gpmRelease (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskGpmRelease() protected function taskGpmRelease()
@@ -763,6 +786,8 @@ class AdminController extends AdminBaseController
/** /**
* Get update status from GPM * Get update status from GPM
* *
* Request: POST /update.json/task:getUpdates (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskGetUpdates() protected function taskGetUpdates()
@@ -835,7 +860,10 @@ class AdminController extends AdminBaseController
} }
/** /**
* Handle getting a new package dependencies needed to be installed * Handle getting a new package dependencies needed to be installed.
*
* Route: /plugins.json/task:getPackagesDependencies (AJAX call)
* Route: /themes.json/task:getPackagesDependencies (AJAX call)
* *
* @return bool * @return bool
*/ */
@@ -868,6 +896,9 @@ class AdminController extends AdminBaseController
} }
/** /**
* Route: /plugins.json/task:installDependenciesOfPackages (AJAX call)
* Route: /themes.json/task:installDependenciesOfPackages (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskInstallDependenciesOfPackages() protected function taskInstallDependenciesOfPackages()
@@ -917,6 +948,9 @@ class AdminController extends AdminBaseController
} }
/** /**
* Route: /plugins.json/task:installPackage (AJAX call)
* Route: /themes.json/task:installPackage (AJAX call)
*
* @param bool $reinstall * @param bool $reinstall
* @return bool * @return bool
*/ */
@@ -973,6 +1007,9 @@ class AdminController extends AdminBaseController
/** /**
* Handle removing a package * Handle removing a package
* *
* Route: /plugins.json/task:removePackage (AJAX call)
* Route: /themes.json/task:removePackage (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskRemovePackage(): bool protected function taskRemovePackage(): bool
@@ -1046,6 +1083,9 @@ class AdminController extends AdminBaseController
/** /**
* Handle reinstalling a package * Handle reinstalling a package
* *
* Route: /plugins.json/task:reinstallPackage (AJAX call)
* Route: /themes.json/task:reinstallPackage (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskReinstallPackage() protected function taskReinstallPackage()
@@ -1092,6 +1132,8 @@ class AdminController extends AdminBaseController
/** /**
* Handle direct install. * Handle direct install.
* *
* Request: POST /tools/direct-install?task=directInstall
*
* @return bool * @return bool
*/ */
protected function taskDirectInstall() protected function taskDirectInstall()
@@ -2179,6 +2221,8 @@ class AdminController extends AdminBaseController
} }
/** /**
* Request: POST .json/task:compileScss (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskCompileScss() protected function taskCompileScss()
@@ -2212,6 +2256,8 @@ class AdminController extends AdminBaseController
} }
/** /**
* Request: POST .json/task:exportScss (AJAX call)
*
* @return bool * @return bool
*/ */
protected function taskExportScss() protected function taskExportScss()