fix some more phpdoc

This commit is contained in:
Robin Appelman 2012-09-23 02:39:11 +02:00
parent f71f731f1c
commit 4131b205d4
13 changed files with 350 additions and 306 deletions

View File

@ -40,7 +40,7 @@ class OC_App{
/** /**
* @brief loads all apps * @brief loads all apps
* @param array $types * @param array $types
* @returns true/false * @return bool
* *
* This function walks through the owncloud directory and loads all apps * This function walks through the owncloud directory and loads all apps
* it can find. A directory contains an app if the file /appinfo/app.php * it can find. A directory contains an app if the file /appinfo/app.php
@ -77,7 +77,7 @@ class OC_App{
/** /**
* load a single app * load a single app
* @param string app * @param string $app
*/ */
public static function loadApp($app) { public static function loadApp($app) {
if(is_file(self::getAppPath($app).'/appinfo/app.php')) { if(is_file(self::getAppPath($app).'/appinfo/app.php')) {
@ -90,6 +90,7 @@ class OC_App{
* check if an app is of a specific type * check if an app is of a specific type
* @param string $app * @param string $app
* @param string/array $types * @param string/array $types
* @return bool
*/ */
public static function isType($app,$types) { public static function isType($app,$types) {
if(is_string($types)) { if(is_string($types)) {
@ -156,8 +157,8 @@ class OC_App{
/** /**
* @brief checks whether or not an app is enabled * @brief checks whether or not an app is enabled
* @param $app app * @param string $app app
* @returns true/false * @return bool
* *
* This function checks whether or not an app is enabled. * This function checks whether or not an app is enabled.
*/ */
@ -171,8 +172,8 @@ class OC_App{
/** /**
* @brief enables an app * @brief enables an app
* @param $app app * @param mixed $app app
* @returns true/false * @return bool
* *
* This function set an app as enabled in appconfig. * This function set an app as enabled in appconfig.
*/ */
@ -202,13 +203,12 @@ class OC_App{
}else{ }else{
return false; return false;
} }
return $app;
} }
/** /**
* @brief disables an app * @brief disables an app
* @param $app app * @param string $app app
* @returns true/false * @return bool
* *
* This function set an app as disabled in appconfig. * This function set an app as disabled in appconfig.
*/ */
@ -219,8 +219,8 @@ class OC_App{
/** /**
* @brief adds an entry to the navigation * @brief adds an entry to the navigation
* @param $data array containing the data * @param string $data array containing the data
* @returns true/false * @return bool
* *
* This function adds a new entry to the navigation visible to users. $data * This function adds a new entry to the navigation visible to users. $data
* is an associative array. * is an associative array.
@ -245,8 +245,8 @@ class OC_App{
/** /**
* @brief marks a navigation entry as active * @brief marks a navigation entry as active
* @param $id id of the entry * @param string $id id of the entry
* @returns true/false * @return bool
* *
* This function sets a navigation entry as active and removes the 'active' * This function sets a navigation entry as active and removes the 'active'
* property from all other entries. The templates can use this for * property from all other entries. The templates can use this for
@ -259,7 +259,7 @@ class OC_App{
/** /**
* @brief gets the active Menu entry * @brief gets the active Menu entry
* @returns id or empty string * @return string id or empty string
* *
* This function returns the id of the active navigation entry (set by * This function returns the id of the active navigation entry (set by
* setActiveNavigationEntry * setActiveNavigationEntry
@ -270,7 +270,7 @@ class OC_App{
/** /**
* @brief Returns the Settings Navigation * @brief Returns the Settings Navigation
* @returns associative array * @return array
* *
* This function returns an array containing all settings pages added. The * This function returns an array containing all settings pages added. The
* entries are sorted by the key 'order' ascending. * entries are sorted by the key 'order' ascending.
@ -291,7 +291,7 @@ class OC_App{
// personal menu // personal menu
$settings[] = array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" )); $settings[] = array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ));
// if there're some settings forms // if there are some settings forms
if(!empty(self::$settingsForms)) if(!empty(self::$settingsForms))
// settings menu // settings menu
$settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" )); $settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" ));
@ -361,6 +361,7 @@ class OC_App{
return $app_dir[$appid]=$dir; return $app_dir[$appid]=$dir;
} }
} }
return false;
} }
/** /**
* Get the directory for the given app. * Get the directory for the given app.
@ -370,6 +371,7 @@ class OC_App{
if( ($dir = self::findAppInDirectories($appid)) != false) { if( ($dir = self::findAppInDirectories($appid)) != false) {
return $dir['path'].'/'.$appid; return $dir['path'].'/'.$appid;
} }
return false;
} }
/** /**
@ -380,6 +382,7 @@ class OC_App{
if( ($dir = self::findAppInDirectories($appid)) != false) { if( ($dir = self::findAppInDirectories($appid)) != false) {
return OC::$WEBROOT.$dir['url'].'/'.$appid; return OC::$WEBROOT.$dir['url'].'/'.$appid;
} }
return false;
} }
/** /**
@ -399,8 +402,8 @@ class OC_App{
/** /**
* @brief Read all app metadata from the info.xml file * @brief Read all app metadata from the info.xml file
* @param string $appid id of the app or the path of the info.xml file * @param string $appid id of the app or the path of the info.xml file
* @param boolean path (optional) * @param boolean $path (optional)
* @returns array * @return array
* @note all data is read from info.xml, not just pre-defined fields * @note all data is read from info.xml, not just pre-defined fields
*/ */
public static function getAppInfo($appid,$path=false) { public static function getAppInfo($appid,$path=false) {
@ -415,24 +418,36 @@ class OC_App{
$data=array(); $data=array();
$content=@file_get_contents($file); $content=@file_get_contents($file);
if(!$content) { if(!$content) {
return; return null;
} }
$xml = new SimpleXMLElement($content); $xml = new SimpleXMLElement($content);
$data['info']=array(); $data['info']=array();
$data['remote']=array(); $data['remote']=array();
$data['public']=array(); $data['public']=array();
foreach($xml->children() as $child) { foreach($xml->children() as $child) {
/**
* @var $child SimpleXMLElement
*/
if($child->getName()=='remote') { if($child->getName()=='remote') {
foreach($child->children() as $remote) { foreach($child->children() as $remote) {
/**
* @var $remote SimpleXMLElement
*/
$data['remote'][$remote->getName()]=(string)$remote; $data['remote'][$remote->getName()]=(string)$remote;
} }
}elseif($child->getName()=='public') { }elseif($child->getName()=='public') {
foreach($child->children() as $public) { foreach($child->children() as $public) {
/**
* @var $public SimpleXMLElement
*/
$data['public'][$public->getName()]=(string)$public; $data['public'][$public->getName()]=(string)$public;
} }
}elseif($child->getName()=='types') { }elseif($child->getName()=='types') {
$data['types']=array(); $data['types']=array();
foreach($child->children() as $type) { foreach($child->children() as $type) {
/**
* @var $type SimpleXMLElement
*/
$data['types'][]=$type->getName(); $data['types'][]=$type->getName();
} }
}elseif($child->getName()=='description') { }elseif($child->getName()=='description') {
@ -449,7 +464,7 @@ class OC_App{
/** /**
* @brief Returns the navigation * @brief Returns the navigation
* @returns associative array * @return array
* *
* This function returns an array containing all entries added. The * This function returns an array containing all entries added. The
* entries are sorted by the key 'order' ascending. Additional to the keys * entries are sorted by the key 'order' ascending. Additional to the keys
@ -494,6 +509,8 @@ class OC_App{
case 'personal': case 'personal':
$source=self::$personalForms; $source=self::$personalForms;
break; break;
default:
return array();
} }
foreach($source as $form) { foreach($source as $form) {
$forms[]=include $form; $forms[]=include $form;
@ -558,7 +575,7 @@ class OC_App{
/** /**
* @brief: get a list of all apps on apps.owncloud.com * @brief: get a list of all apps on apps.owncloud.com
* @return multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description * @return array, multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
*/ */
public static function getAppstoreApps( $filter = 'approved' ) { public static function getAppstoreApps( $filter = 'approved' ) {
@ -674,7 +691,7 @@ class OC_App{
/** /**
* update the database for the app and call the update script * update the database for the app and call the update script
* @param string appid * @param string $appid
*/ */
public static function updateApp($appid) { public static function updateApp($appid) {
if(file_exists(self::getAppPath($appid).'/appinfo/database.xml')) { if(file_exists(self::getAppPath($appid).'/appinfo/database.xml')) {
@ -688,7 +705,7 @@ class OC_App{
include self::getAppPath($appid).'/appinfo/update.php'; include self::getAppPath($appid).'/appinfo/update.php';
} }
//set remote/public handelers //set remote/public handlers
$appData=self::getAppInfo($appid); $appData=self::getAppInfo($appid);
foreach($appData['remote'] as $name=>$path) { foreach($appData['remote'] as $name=>$path) {
OCP\CONFIG::setAppValue('core', 'remote_'.$name, $appid.'/'.$path); OCP\CONFIG::setAppValue('core', 'remote_'.$name, $appid.'/'.$path);
@ -701,7 +718,7 @@ class OC_App{
} }
/** /**
* @param string appid * @param string $appid
* @return OC_FilesystemView * @return OC_FilesystemView
*/ */
public static function getStorage($appid) { public static function getStorage($appid) {

View File

@ -40,7 +40,7 @@
class OC_Appconfig{ class OC_Appconfig{
/** /**
* @brief Get all apps using the config * @brief Get all apps using the config
* @returns array with app ids * @return array with app ids
* *
* This function returns a list of all apps that have at least one * This function returns a list of all apps that have at least one
* entry in the appconfig table. * entry in the appconfig table.
@ -60,8 +60,8 @@ class OC_Appconfig{
/** /**
* @brief Get the available keys for an app * @brief Get the available keys for an app
* @param $app the app we are looking for * @param string $app the app we are looking for
* @returns array with key names * @return array with key names
* *
* This function gets all keys of an app. Please note that the values are * This function gets all keys of an app. Please note that the values are
* not returned. * not returned.
@ -81,13 +81,13 @@ class OC_Appconfig{
/** /**
* @brief Gets the config value * @brief Gets the config value
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $default = null, default value if the key does not exist * @param string $default = null, default value if the key does not exist
* @returns the value or $default * @return string the value or $default
* *
* This function gets a value from the appconfig table. If the key does * This function gets a value from the appconfig table. If the key does
* not exist the default value will be returnes * not exist the default value will be returned
*/ */
public static function getValue( $app, $key, $default = null ) { public static function getValue( $app, $key, $default = null ) {
// At least some magic in here :-) // At least some magic in here :-)
@ -114,10 +114,10 @@ class OC_Appconfig{
/** /**
* @brief sets a value in the appconfig * @brief sets a value in the appconfig
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @return bool
* *
* Sets a value. If the key did not exist before it will be created. * Sets a value. If the key did not exist before it will be created.
*/ */
@ -135,9 +135,9 @@ class OC_Appconfig{
/** /**
* @brief Deletes a key * @brief Deletes a key
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @returns true/false * @return bool
* *
* Deletes a key. * Deletes a key.
*/ */
@ -151,8 +151,8 @@ class OC_Appconfig{
/** /**
* @brief Remove app from appconfig * @brief Remove app from appconfig
* @param $app app * @param string $app app
* @returns true/false * @return bool
* *
* Removes all keys in appconfig belonging to the app. * Removes all keys in appconfig belonging to the app.
*/ */

View File

@ -47,7 +47,7 @@ class OC_Config{
/** /**
* @brief Lists all available config keys * @brief Lists all available config keys
* @returns array with key names * @return array with key names
* *
* This function returns all keys saved in config.php. Please note that it * This function returns all keys saved in config.php. Please note that it
* does not return the values. * does not return the values.
@ -60,9 +60,9 @@ class OC_Config{
/** /**
* @brief Gets a value from config.php * @brief Gets a value from config.php
* @param $key key * @param string $key key
* @param $default = null default value * @param string $default = null default value
* @returns the value or $default * @return string the value or $default
* *
* This function gets the value from config.php. If it does not exist, * This function gets the value from config.php. If it does not exist,
* $default will be returned. * $default will be returned.
@ -79,9 +79,9 @@ class OC_Config{
/** /**
* @brief Sets a value * @brief Sets a value
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @return bool
* *
* This function sets the value and writes the config.php. If the file can * This function sets the value and writes the config.php. If the file can
* not be written, false will be returned. * not be written, false will be returned.
@ -99,8 +99,8 @@ class OC_Config{
/** /**
* @brief Removes a key from the config * @brief Removes a key from the config
* @param $key key * @param string $key key
* @returns true/false * @return bool
* *
* This function removes a key from the config.php. If owncloud has no * This function removes a key from the config.php. If owncloud has no
* write access to config.php, the function will return false. * write access to config.php, the function will return false.
@ -121,7 +121,7 @@ class OC_Config{
/** /**
* @brief Loads the config file * @brief Loads the config file
* @returns true/false * @return bool
* *
* Reads the config file and saves it to the cache * Reads the config file and saves it to the cache
*/ */
@ -148,7 +148,7 @@ class OC_Config{
/** /**
* @brief Writes the config file * @brief Writes the config file
* @returns true/false * @return bool
* *
* Saves the config to the config file. * Saves the config to the config file.
* *

View File

@ -35,12 +35,15 @@
*/ */
class OC_Group { class OC_Group {
// The backend used for group management // The backend used for group management
/**
* @var OC_Group_Interface[]
*/
private static $_usedBackends = array(); private static $_usedBackends = array();
/** /**
* @brief set the group backend * @brief set the group backend
* @param string $backend The backend to use for user managment * @param string $backend The backend to use for user managment
* @returns true/false * @return bool
*/ */
public static function useBackend( $backend ) { public static function useBackend( $backend ) {
if($backend instanceof OC_Group_Interface) { if($backend instanceof OC_Group_Interface) {
@ -57,10 +60,10 @@ class OC_Group {
/** /**
* @brief Try to create a new group * @brief Try to create a new group
* @param $gid The name of the group to create * @param string $gid The name of the group to create
* @returns true/false * @return bool
* *
* Trys to create a new group. If the group name already exists, false will * Tries to create a new group. If the group name already exists, false will
* be returned. Basic checking of Group name * be returned. Basic checking of Group name
* *
* Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-" * Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-"
@ -94,6 +97,7 @@ class OC_Group {
return true; return true;
} }
return false;
}else{ }else{
return false; return false;
} }
@ -101,8 +105,8 @@ class OC_Group {
/** /**
* @brief delete a group * @brief delete a group
* @param $gid gid of the group to delete * @param string $gid gid of the group to delete
* @returns true/false * @return bool
* *
* Deletes a group and removes it from the group_user-table * Deletes a group and removes it from the group_user-table
*/ */
@ -126,6 +130,7 @@ class OC_Group {
return true; return true;
} }
return false;
}else{ }else{
return false; return false;
} }
@ -133,9 +138,9 @@ class OC_Group {
/** /**
* @brief is user in group? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * Checks whether the user is member of a group or not.
*/ */
@ -150,9 +155,9 @@ class OC_Group {
/** /**
* @brief Add a user to a group * @brief Add a user to a group
* @param $uid Name of the user to add to group * @param string $uid Name of the user to add to group
* @param $gid Name of the group in which add the user * @param string $gid Name of the group in which add the user
* @returns true/false * @return bool
* *
* Adds a user to a group. * Adds a user to a group.
*/ */
@ -167,7 +172,7 @@ class OC_Group {
OC_Hook::emit( "OC_Group", "pre_addToGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid )); OC_Hook::emit( "OC_Group", "pre_addToGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid ));
if($run) { if($run) {
$succes=false; $success=false;
//add the user to the all backends that have the group //add the user to the all backends that have the group
foreach(self::$_usedBackends as $backend) { foreach(self::$_usedBackends as $backend) {
@ -175,13 +180,13 @@ class OC_Group {
continue; continue;
if($backend->groupExists($gid)) { if($backend->groupExists($gid)) {
$succes|=$backend->addToGroup($uid, $gid); $success|=$backend->addToGroup($uid, $gid);
} }
} }
if($succes) { if($success) {
OC_Hook::emit( "OC_User", "post_addToGroup", array( "uid" => $uid, "gid" => $gid )); OC_Hook::emit( "OC_User", "post_addToGroup", array( "uid" => $uid, "gid" => $gid ));
} }
return $succes; return $success;
}else{ }else{
return false; return false;
} }
@ -189,9 +194,9 @@ class OC_Group {
/** /**
* @brief Removes a user from a group * @brief Removes a user from a group
* @param $uid Name of the user to remove from group * @param string $uid Name of the user to remove from group
* @param $gid Name of the group from which remove the user * @param string $gid Name of the group from which remove the user
* @returns true/false * @return bool
* *
* removes the user from a group. * removes the user from a group.
*/ */
@ -216,8 +221,8 @@ class OC_Group {
/** /**
* @brief Get all groups a user belongs to * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return array with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -275,7 +280,10 @@ class OC_Group {
/** /**
* @brief get a list of all users in several groups * @brief get a list of all users in several groups
* @param array $gids * @param array $gids
* @returns array with user ids * @param string $search
* @param int $limit
* @param int $offset
* @return array with user ids
*/ */
public static function usersInGroups($gids, $search = '', $limit = -1, $offset = 0) { public static function usersInGroups($gids, $search = '', $limit = -1, $offset = 0) {
$users = array(); $users = array();

View File

@ -47,7 +47,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief Get all supported actions * @brief Get all supported actions
* @returns bitwise-or'ed actions * @return int bitwise-or'ed actions
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc. * compared with OC_USER_BACKEND_CREATE_USER etc.
@ -65,8 +65,8 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief Check if backend implements actions * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_GROUP_BACKEND_CREATE_GROUP etc. * compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
@ -77,9 +77,9 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief is user in group? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * Checks whether the user is member of a group or not.
*/ */
@ -89,8 +89,8 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief Get all groups a user belongs to * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return array with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -101,7 +101,10 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief get a list of all groups * @brief get a list of all groups
* @returns array with group names * @param string $search
* @param int $limit
* @param int $offset
* @return array with group names
* *
* Returns a list with all groups * Returns a list with all groups
*/ */
@ -121,7 +124,11 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
/** /**
* @brief get a list of all users in a group * @brief get a list of all users in a group
* @returns array with user ids * @param string $gid
* @param string $search
* @param int $limit
* @param int $offset
* @return array with user ids
*/ */
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
return array(); return array();

View File

@ -44,10 +44,10 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief Try to create a new group * @brief Try to create a new group
* @param $gid The name of the group to create * @param string $gid The name of the group to create
* @returns true/false * @return bool
* *
* Trys to create a new group. If the group name already exists, false will * Tries to create a new group. If the group name already exists, false will
* be returned. * be returned.
*/ */
public function createGroup( $gid ) { public function createGroup( $gid ) {
@ -70,28 +70,28 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief delete a group * @brief delete a group
* @param $gid gid of the group to delete * @param string $gid gid of the group to delete
* @returns true/false * @return bool
* *
* Deletes a group and removes it from the group_user-table * Deletes a group and removes it from the group_user-table
*/ */
public function deleteGroup( $gid ) { public function deleteGroup( $gid ) {
// Delete the group // Delete the group
$stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*groups` WHERE `gid` = ?" ); $stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*groups` WHERE `gid` = ?" );
$result = $stmt->execute( array( $gid )); $stmt->execute( array( $gid ));
// Delete the group-user relation // Delete the group-user relation
$stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `gid` = ?" ); $stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `gid` = ?" );
$result = $stmt->execute( array( $gid )); $stmt->execute( array( $gid ));
return true; return true;
} }
/** /**
* @brief is user in group? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * Checks whether the user is member of a group or not.
*/ */
@ -105,9 +105,9 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief Add a user to a group * @brief Add a user to a group
* @param $uid Name of the user to add to group * @param string $uid Name of the user to add to group
* @param $gid Name of the group in which add the user * @param string $gid Name of the group in which add the user
* @returns true/false * @return bool
* *
* Adds a user to a group. * Adds a user to a group.
*/ */
@ -124,9 +124,9 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief Removes a user from a group * @brief Removes a user from a group
* @param $uid Name of the user to remove from group * @param string $uid Name of the user to remove from group
* @param $gid Name of the group from which remove the user * @param string $gid Name of the group from which remove the user
* @returns true/false * @return bool
* *
* removes the user from a group. * removes the user from a group.
*/ */
@ -139,8 +139,8 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief Get all groups a user belongs to * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return array with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -160,7 +160,10 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief get a list of all groups * @brief get a list of all groups
* @returns array with group names * @param string $search
* @param int $limit
* @param int $offset
* @return array with group names
* *
* Returns a list with all groups * Returns a list with all groups
*/ */
@ -190,7 +193,11 @@ class OC_Group_Database extends OC_Group_Backend {
/** /**
* @brief get a list of all users in a group * @brief get a list of all users in a group
* @returns array with user ids * @param string $gid
* @param string $search
* @param int $limit
* @param int $offset
* @return array with user ids
*/ */
public function usersInGroup($gid, $search = '', $limit = null, $offset = null) { public function usersInGroup($gid, $search = '', $limit = null, $offset = null) {
$stmt = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ?', $limit, $offset); $stmt = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ?', $limit, $offset);

View File

@ -24,8 +24,8 @@
interface OC_Group_Interface { interface OC_Group_Interface {
/** /**
* @brief Check if backend implements actions * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_GROUP_BACKEND_CREATE_GROUP etc. * compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
@ -34,9 +34,9 @@ interface OC_Group_Interface {
/** /**
* @brief is user in group? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * Checks whether the user is member of a group or not.
*/ */
@ -44,8 +44,8 @@ interface OC_Group_Interface {
/** /**
* @brief Get all groups a user belongs to * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return array with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -54,7 +54,10 @@ interface OC_Group_Interface {
/** /**
* @brief get a list of all groups * @brief get a list of all groups
* @returns array with group names * @param string $search
* @param int $limit
* @param int $offset
* @return array with group names
* *
* Returns a list with all groups * Returns a list with all groups
*/ */
@ -69,8 +72,12 @@ interface OC_Group_Interface {
/** /**
* @brief get a list of all users in a group * @brief get a list of all users in a group
* @returns array with user ids * @param string $gid
* @param string $search
* @param int $limit
* @param int $offset
* @return array with user ids
*/ */
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0);
} }

View File

@ -30,10 +30,10 @@ class OC_Helper {
/** /**
* @brief Creates an url * @brief Creates an url
* @param $app app * @param string $app app
* @param $file file * @param string $file file
* @param $args array with param=>value, will be appended to the returned url * @param array $args array with param=>value, will be appended to the returned url
* @returns the url * @return string the url
* *
* Returns a url to the given app and file. * Returns a url to the given app and file.
*/ */
@ -74,10 +74,10 @@ class OC_Helper {
/** /**
* @brief Creates an absolute url * @brief Creates an absolute url
* @param $app app * @param string $app app
* @param $file file * @param string $file file
* @param $args array with param=>value, will be appended to the returned url * @param array $args array with param=>value, will be appended to the returned url
* @returns the url * @return string the url
* *
* Returns a absolute url to the given app and file. * Returns a absolute url to the given app and file.
*/ */
@ -88,8 +88,8 @@ class OC_Helper {
/** /**
* @brief Makes an $url absolute * @brief Makes an $url absolute
* @param $url the url * @param string $url the url
* @returns the absolute url * @return string the absolute url
* *
* Returns a absolute url to the given app and file. * Returns a absolute url to the given app and file.
*/ */
@ -100,8 +100,8 @@ class OC_Helper {
/** /**
* @brief Creates an absolute url for remote use * @brief Creates an absolute url for remote use
* @param $service id * @param string $service id
* @returns the url * @return string the url
* *
* Returns a absolute url to the given service. * Returns a absolute url to the given service.
*/ */
@ -111,8 +111,8 @@ class OC_Helper {
/** /**
* @brief Creates an absolute url for public use * @brief Creates an absolute url for public use
* @param $service id * @param string $service id
* @returns the url * @return string the url
* *
* Returns a absolute url to the given service. * Returns a absolute url to the given service.
*/ */
@ -122,9 +122,9 @@ class OC_Helper {
/** /**
* @brief Creates path to an image * @brief Creates path to an image
* @param $app app * @param string $app app
* @param $image image name * @param string $image image name
* @returns the url * @return string the url
* *
* Returns the path to the image. * Returns the path to the image.
*/ */
@ -153,8 +153,8 @@ class OC_Helper {
/** /**
* @brief get path to icon of file type * @brief get path to icon of file type
* @param $mimetype mimetype * @param string $mimetype mimetype
* @returns the url * @return string the url
* *
* Returns the path to the image of this file type. * Returns the path to the image of this file type.
*/ */
@ -187,8 +187,8 @@ class OC_Helper {
/** /**
* @brief Make a human file size * @brief Make a human file size
* @param $bytes file size in bytes * @param int $bytes file size in bytes
* @returns a human readable file size * @return string a human readable file size
* *
* Makes 2048 to 2 kB. * Makes 2048 to 2 kB.
*/ */
@ -212,15 +212,14 @@ class OC_Helper {
/** /**
* @brief Make a computer file size * @brief Make a computer file size
* @param $str file size in a fancy format * @param string $str file size in a fancy format
* @returns a file size in bytes * @return int a file size in bytes
* *
* Makes 2kB to 2048. * Makes 2kB to 2048.
* *
* Inspired by: http://www.php.net/manual/en/function.filesize.php#92418 * Inspired by: http://www.php.net/manual/en/function.filesize.php#92418
*/ */
public static function computerFileSize( $str ) { public static function computerFileSize( $str ) {
$bytes = 0;
$str=strtolower($str); $str=strtolower($str);
$bytes_array = array( $bytes_array = array(
@ -249,10 +248,10 @@ class OC_Helper {
} }
/** /**
* @brief Recusive editing of file permissions * @brief Recursive editing of file permissions
* @param $path path to file or folder * @param string $path path to file or folder
* @param $filemode unix style file permissions as integer * @param int $filemode unix style file permissions
* * @return bool
*/ */
static function chmodr($path, $filemode) { static function chmodr($path, $filemode) {
if (!is_dir($path)) if (!is_dir($path))
@ -277,7 +276,7 @@ class OC_Helper {
} }
/** /**
* @brief Recusive copying of folders * @brief Recursive copying of folders
* @param string $src source folder * @param string $src source folder
* @param string $dest target folder * @param string $dest target folder
* *
@ -299,9 +298,9 @@ class OC_Helper {
} }
/** /**
* @brief Recusive deletion of folders * @brief Recursive deletion of folders
* @param string $dir path to the folder * @param string $dir path to the folder
* * @return bool
*/ */
static function rmdirr($dir) { static function rmdirr($dir) {
if(is_dir($dir)) { if(is_dir($dir)) {
@ -317,12 +316,14 @@ class OC_Helper {
} }
if(file_exists($dir)) { if(file_exists($dir)) {
return false; return false;
}else{
return true;
} }
} }
/** /**
* get the mimetype form a local file * get the mimetype form a local file
* @param string path * @param string $path
* @return string * @return string
* does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
*/ */
@ -379,7 +380,7 @@ class OC_Helper {
/** /**
* get the mimetype form a data string * get the mimetype form a data string
* @param string data * @param string $data
* @return string * @return string
*/ */
static function getStringMimeType($data) { static function getStringMimeType($data) {
@ -399,9 +400,9 @@ class OC_Helper {
/** /**
* @brief Checks $_REQUEST contains a var for the $s key. If so, returns the html-escaped value of this var; otherwise returns the default value provided by $d. * @brief Checks $_REQUEST contains a var for the $s key. If so, returns the html-escaped value of this var; otherwise returns the default value provided by $d.
* @param $s name of the var to escape, if set. * @param string $s name of the var to escape, if set.
* @param $d default value. * @param string $d default value.
* @returns the print-safe value. * @return string the print-safe value.
* *
*/ */
@ -415,7 +416,7 @@ class OC_Helper {
} }
/** /**
* returns "checked"-attribut if request contains selected radio element OR if radio element is the default one -- maybe? * returns "checked"-attribute if request contains selected radio element OR if radio element is the default one -- maybe?
* @param string $s Name of radio-button element name * @param string $s Name of radio-button element name
* @param string $v Value of current radio-button element * @param string $v Value of current radio-button element
* @param string $d Value of default radio-button element * @param string $d Value of default radio-button element
@ -428,8 +429,8 @@ class OC_Helper {
/** /**
* detect if a given program is found in the search PATH * detect if a given program is found in the search PATH
* *
* @param string program name * @param string $program name
* @param string optional search path, defaults to $PATH * @param string $optional search path, defaults to $PATH
* @return bool true if executable program found in path * @return bool true if executable program found in path
*/ */
public static function canExecute($name, $path = false) { public static function canExecute($name, $path = false) {
@ -451,18 +452,16 @@ class OC_Helper {
$dirs = explode(PATH_SEPARATOR, $path); $dirs = explode(PATH_SEPARATOR, $path);
// WARNING : We have to check if open_basedir is enabled : // WARNING : We have to check if open_basedir is enabled :
$obd = ini_get('open_basedir'); $obd = ini_get('open_basedir');
if($obd != "none") if($obd != "none"){
$obd_values = explode(PATH_SEPARATOR, $obd); $obd_values = explode(PATH_SEPARATOR, $obd);
if(count($obd_values) > 0 and $obd_values[0]) if(count($obd_values) > 0 and $obd_values[0]){
{ // open_basedir is in effect !
// open_basedir is in effect ! // We need to check if the program is in one of these dirs :
// We need to check if the program is in one of these dirs : $dirs = $obd_values;
$dirs = $obd_values; }
} }
foreach($dirs as $dir) foreach($dirs as $dir){
{ foreach($exts as $ext){
foreach($exts as $ext)
{
if($check_fn("$dir/$name".$ext)) if($check_fn("$dir/$name".$ext))
return true; return true;
} }
@ -472,8 +471,8 @@ class OC_Helper {
/** /**
* copy the contents of one stream to another * copy the contents of one stream to another
* @param resource source * @param resource $source
* @param resource target * @param resource $target
* @return int the number of bytes copied * @return int the number of bytes copied
*/ */
public static function streamCopy($source,$target) { public static function streamCopy($source,$target) {
@ -489,7 +488,7 @@ class OC_Helper {
/** /**
* create a temporary file with an unique filename * create a temporary file with an unique filename
* @param string postfix * @param string $postfix
* @return string * @return string
* *
* temporary files are automatically cleaned up after the script is finished * temporary files are automatically cleaned up after the script is finished
@ -553,10 +552,10 @@ class OC_Helper {
$ext = substr($filename, $pos); $ext = substr($filename, $pos);
} else { } else {
$name = $filename; $name = $filename;
$ext = '';
} }
$newpath = $path . '/' . $filename; $newpath = $path . '/' . $filename;
$newname = $filename;
$counter = 2; $counter = 2;
while (OC_Filesystem::file_exists($newpath)) { while (OC_Filesystem::file_exists($newpath)) {
$newname = $name . ' (' . $counter . ')' . $ext; $newname = $name . ' (' . $counter . ')' . $ext;
@ -570,8 +569,8 @@ class OC_Helper {
/* /*
* checks if $sub is a subdirectory of $parent * checks if $sub is a subdirectory of $parent
* *
* @param $sub * @param string $sub
* @param $parent * @param string $parent
* @return bool * @return bool
*/ */
public static function issubdirectory($sub, $parent) { public static function issubdirectory($sub, $parent) {
@ -604,9 +603,9 @@ class OC_Helper {
/** /**
* @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is. * @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
* *
* @param $input The array to work on * @param array $input The array to work on
* @param $case Either MB_CASE_UPPER or MB_CASE_LOWER (default) * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
* @return array * @return array
* *
* Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is. * Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
@ -625,11 +624,11 @@ class OC_Helper {
/** /**
* @brief replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement. * @brief replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
* *
* @param $input The input string. .Opposite to the PHP build-in function does not accept an array. * @param string $input The input string. .Opposite to the PHP build-in function does not accept an array.
* @param $replacement The replacement string. * @param string $replacement The replacement string.
* @param $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string. * @param int $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
* @param $length Length of the part to be replaced * @param int $length Length of the part to be replaced
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
* @return string * @return string
* *
*/ */
@ -646,11 +645,11 @@ class OC_Helper {
/** /**
* @brief Replace all occurrences of the search string with the replacement string * @brief Replace all occurrences of the search string with the replacement string
* *
* @param $search The value being searched for, otherwise known as the needle. String. * @param string $search The value being searched for, otherwise known as the needle.
* @param $replace The replacement string. * @param string $replace The replacement
* @param $subject The string or array being searched and replaced on, otherwise known as the haystack. * @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
* @param $encoding The encoding parameter is the character encoding. Defaults to UTF-8 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
* @param $count If passed, this will be set to the number of replacements performed. * @param int $count If passed, this will be set to the number of replacements performed.
* @return string * @return string
* *
*/ */
@ -667,10 +666,10 @@ class OC_Helper {
/** /**
* @brief performs a search in a nested array * @brief performs a search in a nested array
* @param haystack the array to be searched * @param array $haystack the array to be searched
* @param needle the search string * @param string $needle the search string
* @param $index optional, only search this key name * @param string $index optional, only search this key name
* @return the key of the matching field, otherwise false * @return mixed the key of the matching field, otherwise false
* *
* performs a search in a nested array * performs a search in a nested array
* *

View File

@ -9,11 +9,11 @@ class OC_Hook{
/** /**
* @brief connects a function to a hook * @brief connects a function to a hook
* @param $signalclass class name of emitter * @param string $signalclass class name of emitter
* @param $signalname name of signal * @param string $signalname name of signal
* @param $slotclass class name of slot * @param string $slotclass class name of slot
* @param $slotname name of slot * @param string $slotname name of slot
* @returns true/false * @return bool
* *
* This function makes it very easy to connect to use hooks. * This function makes it very easy to connect to use hooks.
* *
@ -38,11 +38,11 @@ class OC_Hook{
} }
/** /**
* @brief emitts a signal * @brief emits a signal
* @param $signalclass class name of emitter * @param string $signalclass class name of emitter
* @param $signalname name of signal * @param string $signalname name of signal
* @param $params defautl: array() array with additional data * @param array $params defautl: array() array with additional data
* @returns true if slots exists or false if not * @return bool, true if slots exists or false if not
* *
* Emits a signal. To get data from the slot use references! * Emits a signal. To get data from the slot use references!
* *
@ -68,8 +68,8 @@ class OC_Hook{
/** /**
* clear hooks * clear hooks
* @param string signalclass * @param string $signalclass
* @param string signalname * @param string $signalname
*/ */
static public function clear($signalclass='', $signalname='') { static public function clear($signalclass='', $signalname='') {
if($signalclass) { if($signalclass) {

View File

@ -140,7 +140,7 @@ class OC_L10N{
/** /**
* @brief Translating * @brief Translating
* @param $text String The text we need a translation for * @param $text String The text we need a translation for
* @param array|\default $parameters default:array() Parameters for sprintf * @param array $parameters default:array() Parameters for sprintf
* @return \OC_L10N_String Translation or the same text * @return \OC_L10N_String Translation or the same text
* *
* Returns the translation. If no translation is found, $text will be * Returns the translation. If no translation is found, $text will be

View File

@ -40,7 +40,7 @@
class OC_Preferences{ class OC_Preferences{
/** /**
* @brief Get all users using the preferences * @brief Get all users using the preferences
* @returns array with user ids * @return array with user ids
* *
* This function returns a list of all users that have at least one entry * This function returns a list of all users that have at least one entry
* in the preferences table. * in the preferences table.
@ -60,8 +60,8 @@ class OC_Preferences{
/** /**
* @brief Get all apps of a user * @brief Get all apps of a user
* @param $user user * @param string $user user
* @returns array with app ids * @return array with app ids
* *
* This function returns a list of all apps of the user that have at least * This function returns a list of all apps of the user that have at least
* one entry in the preferences table. * one entry in the preferences table.
@ -81,9 +81,9 @@ class OC_Preferences{
/** /**
* @brief Get the available keys for an app * @brief Get the available keys for an app
* @param $user user * @param string $user user
* @param $app the app we are looking for * @param string $app the app we are looking for
* @returns array with key names * @return array with key names
* *
* This function gets all keys of an app of an user. Please note that the * This function gets all keys of an app of an user. Please note that the
* values are not returned. * values are not returned.
@ -103,14 +103,14 @@ class OC_Preferences{
/** /**
* @brief Gets the preference * @brief Gets the preference
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $default = null, default value if the key does not exist * @param string $default = null, default value if the key does not exist
* @returns the value or $default * @return string the value or $default
* *
* This function gets a value from the prefernces table. If the key does * This function gets a value from the preferences table. If the key does
* not exist the default value will be returnes * not exist the default value will be returned
*/ */
public static function getValue( $user, $app, $key, $default = null ) { public static function getValue( $user, $app, $key, $default = null ) {
// Try to fetch the value, return default if not exists. // Try to fetch the value, return default if not exists.
@ -127,11 +127,11 @@ class OC_Preferences{
/** /**
* @brief sets a value in the preferences * @brief sets a value in the preferences
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @return bool
* *
* Adds a value to the preferences. If the key did not exist before, it * Adds a value to the preferences. If the key did not exist before, it
* will be added automagically. * will be added automagically.
@ -155,63 +155,63 @@ class OC_Preferences{
/** /**
* @brief Deletes a key * @brief Deletes a key
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @returns true/false * @return bool
* *
* Deletes a key. * Deletes a key.
*/ */
public static function deleteKey( $user, $app, $key ) { public static function deleteKey( $user, $app, $key ) {
// No need for more comments // No need for more comments
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' ); $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
$result = $query->execute( array( $user, $app, $key )); $query->execute( array( $user, $app, $key ));
return true; return true;
} }
/** /**
* @brief Remove app of user from preferences * @brief Remove app of user from preferences
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @returns true/false * @return bool
* *
* Removes all keys in appconfig belonging to the app and the user. * Removes all keys in appconfig belonging to the app and the user.
*/ */
public static function deleteApp( $user, $app ) { public static function deleteApp( $user, $app ) {
// No need for more comments // No need for more comments
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?' ); $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?' );
$result = $query->execute( array( $user, $app )); $query->execute( array( $user, $app ));
return true; return true;
} }
/** /**
* @brief Remove user from preferences * @brief Remove user from preferences
* @param $user user * @param string $user user
* @returns true/false * @return bool
* *
* Removes all keys in appconfig belonging to the user. * Removes all keys in appconfig belonging to the user.
*/ */
public static function deleteUser( $user ) { public static function deleteUser( $user ) {
// No need for more comments // No need for more comments
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?' ); $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?' );
$result = $query->execute( array( $user )); $query->execute( array( $user ));
return true; return true;
} }
/** /**
* @brief Remove app from all users * @brief Remove app from all users
* @param $app app * @param string $app app
* @returns true/false * @return bool
* *
* Removes all keys in preferences belonging to the app. * Removes all keys in preferences belonging to the app.
*/ */
public static function deleteAppFromAllUsers( $app ) { public static function deleteAppFromAllUsers( $app ) {
// No need for more comments // No need for more comments
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `appid` = ?' ); $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `appid` = ?' );
$result = $query->execute( array( $app )); $query->execute( array( $app ));
return true; return true;
} }

View File

@ -40,9 +40,9 @@ namespace OCP;
class Config { class Config {
/** /**
* @brief Gets a value from config.php * @brief Gets a value from config.php
* @param $key key * @param string $key key
* @param $default = null default value * @param string $default = null default value
* @returns the value or $default * @return string the value or $default
* *
* This function gets the value from config.php. If it does not exist, * This function gets the value from config.php. If it does not exist,
* $default will be returned. * $default will be returned.
@ -53,9 +53,9 @@ class Config {
/** /**
* @brief Sets a value * @brief Sets a value
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @return bool
* *
* This function sets the value and writes the config.php. If the file can * This function sets the value and writes the config.php. If the file can
* not be written, false will be returned. * not be written, false will be returned.
@ -66,13 +66,13 @@ class Config {
/** /**
* @brief Gets the config value * @brief Gets the config value
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $default = null, default value if the key does not exist * @param string $default = null, default value if the key does not exist
* @returns the value or $default * @return string the value or $default
* *
* This function gets a value from the appconfig table. If the key does * This function gets a value from the appconfig table. If the key does
* not exist the default value will be returnes * not exist the default value will be returned
*/ */
public static function getAppValue( $app, $key, $default = null ) { public static function getAppValue( $app, $key, $default = null ) {
return(\OC_Appconfig::getValue( $app, $key, $default )); return(\OC_Appconfig::getValue( $app, $key, $default ));
@ -80,10 +80,10 @@ class Config {
/** /**
* @brief sets a value in the appconfig * @brief sets a value in the appconfig
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @return string true/false
* *
* Sets a value. If the key did not exist before it will be created. * Sets a value. If the key did not exist before it will be created.
*/ */
@ -93,14 +93,14 @@ class Config {
/** /**
* @brief Gets the preference * @brief Gets the preference
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $default = null, default value if the key does not exist * @param string $default = null, default value if the key does not exist
* @returns the value or $default * @return string the value or $default
* *
* This function gets a value from the prefernces table. If the key does * This function gets a value from the preferences table. If the key does
* not exist the default value will be returnes * not exist the default value will be returned
*/ */
public static function getUserValue( $user, $app, $key, $default = null ) { public static function getUserValue( $user, $app, $key, $default = null ) {
return(\OC_Preferences::getValue( $user, $app, $key, $default )); return(\OC_Preferences::getValue( $user, $app, $key, $default ));
@ -108,16 +108,16 @@ class Config {
/** /**
* @brief sets a value in the preferences * @brief sets a value in the preferences
* @param $user user * @param string $user user
* @param $app app * @param string $app app
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true/false * @returns bool
* *
* Adds a value to the preferences. If the key did not exist before, it * Adds a value to the preferences. If the key did not exist before, it
* will be added automagically. * will be added automagically.
*/ */
public static function setUserValue( $user, $app, $key, $value ) { public static function setUserValue( $user, $app, $key, $value ) {
return(\OC_Preferences::setValue( $user, $app, $key, $value )); return(\OC_Preferences::setValue( $user, $app, $key, $value ));
} }
} }

View File

@ -23,10 +23,10 @@
/** /**
* @brief make OC_Helper::linkTo available as a simple function * @brief make OC_Helper::linkTo available as a simple function
* @param $app app * @param string $app app
* @param $file file * @param string $file file
* @param $args array with param=>value, will be appended to the returned url * @param array $args array with param=>value, will be appended to the returned url
* @returns link to the file * @return string link to the file
* *
* For further information have a look at OC_Helper::linkTo * For further information have a look at OC_Helper::linkTo
*/ */
@ -36,9 +36,9 @@ function link_to( $app, $file, $args = array() ) {
/** /**
* @brief make OC_Helper::imagePath available as a simple function * @brief make OC_Helper::imagePath available as a simple function
* @param $app app * @param string $app app
* @param $image image * @param string $image image
* @returns link to the image * @return string link to the image
* *
* For further information have a look at OC_Helper::imagePath * For further information have a look at OC_Helper::imagePath
*/ */
@ -48,8 +48,8 @@ function image_path( $app, $image ) {
/** /**
* @brief make OC_Helper::mimetypeIcon available as a simple function * @brief make OC_Helper::mimetypeIcon available as a simple function
* @param $mimetype mimetype * @param string $mimetype mimetype
* @returns link to the image * @return string link to the image
* *
* For further information have a look at OC_Helper::mimetypeIcon * For further information have a look at OC_Helper::mimetypeIcon
*/ */
@ -59,8 +59,8 @@ function mimetype_icon( $mimetype ) {
/** /**
* @brief make OC_Helper::humanFileSize available as a simple function * @brief make OC_Helper::humanFileSize available as a simple function
* @param $bytes size in bytes * @param int $bytes size in bytes
* @returns size as string * @return string size as string
* *
* For further information have a look at OC_Helper::humanFileSize * For further information have a look at OC_Helper::humanFileSize
*/ */
@ -139,10 +139,10 @@ class OC_Template{
/** /**
* @brief Constructor * @brief Constructor
* @param $app app providing the template * @param string $app app providing the template
* @param $file name of the template file (without suffix) * @param string $file name of the template file (without suffix)
* @param $renderas = ""; produce a full page * @param string $renderas = ""; produce a full page
* @returns OC_Template object * @return OC_Template object
* *
* This function creates an OC_Template object. * This function creates an OC_Template object.
* *
@ -168,7 +168,7 @@ class OC_Template{
} }
/** /**
* autodetects the formfactor of the used device * autodetect the formfactor of the used device
* default -> the normal desktop browser interface * default -> the normal desktop browser interface
* mobile -> interface for smartphones * mobile -> interface for smartphones
* tablet -> interface for tablets * tablet -> interface for tablets
@ -226,7 +226,7 @@ class OC_Template{
/** /**
* @brief find the template with the given name * @brief find the template with the given name
* @param $name of the template file (without suffix) * @param string $name of the template file (without suffix)
* *
* Will select the template file for the selected theme and formfactor. * Will select the template file for the selected theme and formfactor.
* Checking all the possible locations. * Checking all the possible locations.
@ -271,13 +271,13 @@ class OC_Template{
/** /**
* @brief check Path For Template with and without $fext * @brief check Path For Template with and without $fext
* @param $path to check * @param string $path to check
* @param $name of the template file (without suffix) * @param string $name of the template file (without suffix)
* @param $fext formfactor extension * @param string $fext formfactor extension
* @return bool true when found * @return bool true when found
* *
* Will set $this->template and $this->path if there is a template at * Will set $this->template and $this->path if there is a template at
* the specifief $path * the specific $path
*/ */
protected function checkPathForTemplate($path, $name, $fext) protected function checkPathForTemplate($path, $name, $fext)
{ {
@ -298,10 +298,10 @@ class OC_Template{
/** /**
* @brief Assign variables * @brief Assign variables
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @param $sanitizeHTML false, if data shouldn't get passed through htmlentities * @param bool $sanitizeHTML false, if data shouldn't get passed through htmlentities
* @returns true * @return bool
* *
* This function assigns a variable. It can be accessed via $_[$key] in * This function assigns a variable. It can be accessed via $_[$key] in
* the template. * the template.
@ -316,9 +316,9 @@ class OC_Template{
/** /**
* @brief Appends a variable * @brief Appends a variable
* @param $key key * @param string $key key
* @param $value value * @param string $value value
* @returns true * @return bool
* *
* This function assigns a variable in an array context. If the key already * This function assigns a variable in an array context. If the key already
* exists, the value will be appended. It can be accessed via * exists, the value will be appended. It can be accessed via
@ -335,7 +335,7 @@ class OC_Template{
/** /**
* @brief Add a custom element to the header * @brief Add a custom element to the header
* @param string tag tag name of the element * @param string $tag tag name of the element
* @param array $attributes array of attrobutes for the element * @param array $attributes array of attrobutes for the element
* @param string $text the text content for the element * @param string $text the text content for the element
*/ */
@ -345,7 +345,7 @@ class OC_Template{
/** /**
* @brief Prints the proceeded template * @brief Prints the proceeded template
* @returns true/false * @return bool
* *
* This function proceeds the template and prints its output. * This function proceeds the template and prints its output.
*/ */
@ -362,7 +362,7 @@ class OC_Template{
/** /**
* @brief Proceeds the template * @brief Proceeds the template
* @returns content * @return bool
* *
* This function proceeds the template. If $this->renderas is set, it * This function proceeds the template. If $this->renderas is set, it
* will produce a full page. * will produce a full page.
@ -392,7 +392,7 @@ class OC_Template{
/** /**
* @brief doing the actual work * @brief doing the actual work
* @returns content * @return string content
* *
* Includes the template file, fetches its output * Includes the template file, fetches its output
*/ */
@ -413,13 +413,12 @@ class OC_Template{
/** /**
* @brief Include template * @brief Include template
* @returns returns content of included template * @return string returns content of included template
* *
* Includes another template. use <?php echo $this->inc('template'); ?> to * Includes another template. use <?php echo $this->inc('template'); ?> to
* do this. * do this.
*/ */
public function inc( $file, $additionalparams = null ) { public function inc( $file, $additionalparams = null ) {
// $_ erstellen
$_ = $this->vars; $_ = $this->vars;
$l = $this->l10n; $l = $this->l10n;
@ -439,10 +438,10 @@ class OC_Template{
/** /**
* @brief Shortcut to print a simple page for users * @brief Shortcut to print a simple page for users
* @param $application The application we render the template for * @param string $application The application we render the template for
* @param $name Name of the template * @param string $name Name of the template
* @param $parameters Parameters for the template * @param array $parameters Parameters for the template
* @returns true/false * @return bool
*/ */
public static function printUserPage( $application, $name, $parameters = array() ) { public static function printUserPage( $application, $name, $parameters = array() ) {
$content = new OC_Template( $application, $name, "user" ); $content = new OC_Template( $application, $name, "user" );
@ -454,10 +453,10 @@ class OC_Template{
/** /**
* @brief Shortcut to print a simple page for admins * @brief Shortcut to print a simple page for admins
* @param $application The application we render the template for * @param string $application The application we render the template for
* @param $name Name of the template * @param string $name Name of the template
* @param $parameters Parameters for the template * @param array $parameters Parameters for the template
* @returns true/false * @return bool
*/ */
public static function printAdminPage( $application, $name, $parameters = array() ) { public static function printAdminPage( $application, $name, $parameters = array() ) {
$content = new OC_Template( $application, $name, "admin" ); $content = new OC_Template( $application, $name, "admin" );
@ -469,10 +468,10 @@ class OC_Template{
/** /**
* @brief Shortcut to print a simple page for guests * @brief Shortcut to print a simple page for guests
* @param $application The application we render the template for * @param string $application The application we render the template for
* @param $name Name of the template * @param string $name Name of the template
* @param $parameters Parameters for the template * @param string $parameters Parameters for the template
* @returns true/false * @return bool
*/ */
public static function printGuestPage( $application, $name, $parameters = array() ) { public static function printGuestPage( $application, $name, $parameters = array() ) {
$content = new OC_Template( $application, $name, "guest" ); $content = new OC_Template( $application, $name, "guest" );