diff --git a/README.md b/README.md index 1a238d93..9102b66a 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ Backend: ## Comments for functions and methods Please add the following structure commenting what it does the function, also add the stamp `=== Bludit v4` so I know what is new. ``` -/* Delete a page === Bludit v4 - - @key string Array => (key: string) - @return string/bool Returns the page key on successful delete, FALSE otherwise -*/ -function deletePage($args) { +/** + * Create a new category. === Bludit v4 + * @param array $args [string $name, string $template, string $description] + * @return string|bool Returns the category key on successful create, FALSE otherwise + */ +function createCategory($args) { ... } ``` diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php index 0e3a76fd..072589ee 100644 --- a/bl-kernel/functions.php +++ b/bl-kernel/functions.php @@ -1,21 +1,21 @@ (key: string) - @return string/bool Returns the page key on successful delete, FALSE otherwise -*/ +/** + * Delete a page. === Bludit v4 + * @param array $args [string $key] + * @return string|bool Returns the page key on successful delete, FALSE otherwise + */ function deletePage($args) { global $pages; global $syslog; @@ -133,11 +133,11 @@ function deletePage($args) { return false; } -/* Create a new category === Bludit v4 - - @args array Array => (name: string, template: string, description: string) - @return string/bool Returns the category key on successful create, FALSE otherwise -*/ +/** + * Create a new category. === Bludit v4 + * @param array $args [string $name, string $template, string $description] + * @return string|bool Returns the category key on successful create, FALSE otherwise + */ function createCategory($args) { global $categories; global $syslog; @@ -162,11 +162,11 @@ function createCategory($args) { return false; } -/* Edit a category === Bludit v4 - - @args array Array => (key: string, name: string, friendlyURL: string, template: string, description: string) - @return string/bool Returns the category key on successful edit, FALSE otherwise -*/ +/** + * Edit a category. === Bludit v4 + * @param array $args [string $key, string $name, string $friendlyURL, string $template, string $description] + * @return string|bool Returns the category key on successful edit, FALSE otherwise + */ function editCategory($args) { global $pages; global $categories; @@ -210,11 +210,11 @@ function editCategory($args) { return $finalKey; } -/* Delete a category === Bludit v4 - - @args array Array => (key: string) - @return bool Returns TRUE on successful delete, FALSE otherwise -*/ +/** + * Delete a category. === Bludit v4 + * @param array $args [string $key] + * @return string|bool Returns TRUE on successful delete, FALSE otherwise + */ function deleteCategory($args) { global $categories; global $syslog; @@ -238,12 +238,12 @@ function deleteCategory($args) { return true; } -/* Create a new user === Bludit v4 - This function should check everthing, such as empty username, emtpy password, password lenght, etc - - @args array The array $args supports all the keys from the variable $dbFields of the class users.class.php - @return string/bool Returns the username on successful create, FALSE otherwise -*/ +/** + * Create an user. === Bludit v4 + * This function should check everthing, such as empty username, emtpy password, password lenght, etc + * @param array $args All supported keys are defined in the class users.class.php variable $dbFields + * @return string|bool Returns the username on successful create, FALSE otherwise + */ function createUser($args) { global $users; global $syslog; @@ -275,13 +275,13 @@ function createUser($args) { return false; } -/* Edit an user === Bludit v4 - - @args array The array $args supports all the keys from the variable $dbFields of the class users.class.php - @args['disable'] bool If you set this variable the user will be disabled - @args['password'] string If you set this variable a new password will be set for the user - @return string/bool Returns the username on successful edit, FALSE otherwise -*/ +/** + * Edit an user. === Bludit v4 + * @param array $args All supported keys are defined in the class users.class.php variable $dbFields + * @param bool $args['disable'] If you set this variable the user will be disabled + * @param string $args['password'] If you set this variable a new password will be set for the user + * @return string|bool Returns TRUE on successful delete, FALSE otherwise + */ function editUser($args) { global $users; global $syslog; diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php index 9ebd124d..db3c02cc 100644 --- a/bl-plugins/api/plugin.php +++ b/bl-plugins/api/plugin.php @@ -586,8 +586,8 @@ class pluginAPI extends Plugin { } /** - * Edit settings. - * @param array $args Keys defined in the class site.class.php variable $dbFields + * Edit settings + * @param array $args All supported keys are defined in the class site.class.php variable $dbFields * @return array */ private function editSettings($args) @@ -610,7 +610,7 @@ class pluginAPI extends Plugin { | The list of pages are the page's key | | @return array - */ + */ private function getCategories() { global $categories; @@ -634,7 +634,7 @@ class pluginAPI extends Plugin { | @key string Category key | | @return array - */ + */ private function getCategory($key) { try { @@ -729,7 +729,7 @@ class pluginAPI extends Plugin { | @username string Username | | @return array - */ + */ private function getUser($username) { try { @@ -753,7 +753,7 @@ class pluginAPI extends Plugin { | Returns all the users | | @return array - */ + */ private function getUsers() { global $users; @@ -939,7 +939,7 @@ class pluginAPI extends Plugin { @pageKey string The page's key @return['data'] array The list of files - */ + */ private function getFiles($pageKey) { $chunk = false;