From d4511b966ba688f9e00390df6111743c7d9196cd Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Mon, 31 Oct 2011 09:45:37 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- actions/item_create.php | 12 +- actions/item_search_app.php | 2 +- controllers/index.php | 2 +- controllers/item.php | 46 +++--- controllers/login.php | 4 +- controllers/status.php | 22 +-- css/core.css | 10 +- css/reset.css | 12 +- css/tokeninput.css | 4 +- external/helper.php | 2 +- external/podio-php/PodioAPI.php | 110 +++++++------- external/podio-php/PodioOAuth.php | 38 ++--- external/podio-php/README.markdown | 20 +-- external/podio-php/app/app.class.inc.php | 120 +++++++-------- .../app_store/app_store.class.inc.php | 50 +++---- .../podio-php/bulletin/bulletin.class.inc.php | 16 +- .../podio-php/calendar/calendar.class.inc.php | 30 ++-- .../podio-php/comment/comment.class.inc.php | 24 +-- .../podio-php/contact/contact.class.inc.php | 56 +++---- .../conversation/conversation.class.inc.php | 20 +-- external/podio-php/file/file.class.inc.php | 48 +++--- .../podio-php/filter/filter.class.inc.php | 14 +- external/podio-php/form/form.class.inc.php | 20 +-- .../integration/integration.class.inc.php | 2 +- external/podio-php/item/item.class.inc.php | 138 +++++++++--------- .../notification/notification.class.inc.php | 46 +++--- external/podio-php/org/org.class.inc.php | 32 ++-- .../podio-php/rating/rating.class.inc.php | 20 +-- .../podio-php/search/search.class.inc.php | 4 +- external/podio-php/space/space.class.inc.php | 76 +++++----- .../podio-php/status/status.class.inc.php | 34 ++--- .../podio-php/stream/stream.class.inc.php | 44 +++--- .../subscription/subscription.class.inc.php | 12 +- external/podio-php/tag/tag.class.inc.php | 28 ++-- external/podio-php/task/task.class.inc.php | 50 +++---- external/podio-php/user/user.class.inc.php | 50 +++---- .../podio-php/widget/widget.class.inc.php | 20 +-- lib/app.js | 34 ++--- .../custom-theme/jquery-ui-1.8.7.custom.css | 4 +- lib/jquery.mousewheel.min.js | 2 +- lib/jquery.tokeninput.js | 20 +-- lib/lawnchair/Lawnchair.js | 20 +-- lib/lawnchair/adaptors/AIRSqliteAdaptor.js | 68 ++++----- .../adaptors/AIRSqliteAsyncAdaptor.js | 66 ++++----- lib/lawnchair/adaptors/CouchAdaptor.js | 22 +-- lib/lawnchair/adaptors/DOMStorageAdaptor.js | 4 +- lib/lawnchair/adaptors/GearsSQLiteAdaptor.js | 16 +- lib/lawnchair/adaptors/UserDataStorage.js | 16 +- lib/lawnchair/adaptors/WebkitSQLiteAdaptor.js | 8 +- lib/mustache.js | 2 +- views/feedback.html | 2 +- views/help.html | 2 +- views/index.html | 10 +- views/item_new.html | 10 +- views/login.html | 8 +- 55 files changed, 776 insertions(+), 776 deletions(-) diff --git a/actions/item_create.php b/actions/item_create.php index 19e6eab..8398322 100644 --- a/actions/item_create.php +++ b/actions/item_create.php @@ -24,7 +24,7 @@ [219912] => Array ( [start] => 01/07/2011 20:00 - [end] => + [end] => ) [219913] => desc @@ -36,8 +36,8 @@ [219912_start_date] => 01/07/2011 [219912_start_time] => 20:00 - [219912_end_date] => - [219912_end_time] => + [219912_end_date] => + [219912_end_time] => ) */ // create that item @@ -52,7 +52,7 @@ case 'media']: case 'money']: case 'video']:*/ - + case 'title': case 'text': case 'state': @@ -93,7 +93,7 @@ if ($field['start'] != '') { $newField["field_id"] = $field_id; $dateTime = explode(" ", $field['start']); - + $date = explode("/", $dateTime[0]); $newField['values'][0]["start"] = $date[2] . "-" . $date[0] . "-" . $date[1]; if (isset($dateTime[1]) && $dateTime[1] != '') { // time given as well? @@ -114,7 +114,7 @@ } break; } - + if (isset($newField["field_id"])) { $newItem['fields'][] = $newField; } diff --git a/actions/item_search_app.php b/actions/item_search_app.php index d42bd50..7dc57f9 100644 --- a/actions/item_search_app.php +++ b/actions/item_search_app.php @@ -17,7 +17,7 @@ } else { $return['error'] = true; } - + echo isset($_GET['callback']) ? "{$_GET['callback']}($result)" : $return; diff --git a/controllers/index.php b/controllers/index.php index a5d7390..1657cd7 100644 --- a/controllers/index.php +++ b/controllers/index.php @@ -4,7 +4,7 @@ class index extends Mustache { public $APP_NAME = APP_NAME; public $APP_ROOT_URL = APP_ROOT_URL; public $GOOGLE_ANALYTICS_ID = false; - + public function __construct ($aApp) { if (isset($aApp['google_analytics_id'])) { $this->GOOGLE_ANALYTICS_ID = $aApp['google_analytics_id']; diff --git a/controllers/item.php b/controllers/item.php index b29e8ac..b12cacf 100644 --- a/controllers/item.php +++ b/controllers/item.php @@ -4,30 +4,30 @@ class item extends Mustache { public $APP_NAME = APP_NAME; public $APP_ROOT_URL = APP_ROOT_URL; public $PODIO_ICON_PATH = PODIO_ICON_PATH; - + private $api = null; - + public $appId = -1; public $spaceId = -1; public $spaceName = ''; public $spaceUrl = ''; - + private $app; - + private $fields = array(); - + private $fieldStateFunctions = array(); - + public function __construct($api, $appId = -1) { $this->api = $api; $this->appId = $appId; - + $oauth = PodioOAuth::instance(); // render fields $app = $api->app->get($this->appId); $this->app = $app['config']; $this->spaceId = $app['space_id']; - + // create temporary array with given values $space = $api->space->get($app['space_id']); if ($space['name'] != '') { @@ -52,14 +52,14 @@ public function __construct($api, $appId = -1) { $newField['progress'] = false; $newField['location'] = false; $newField['video'] = false; - + $newField['value'] = ""; $newField["field_id"] = $field['field_id']; $newField['name'] = $field['config']['name']; $newField['required'] = $field['config']['required']; $newField['label'] = $field['config']['label']; $newField['type'] = $field['type']; - + switch ($field['type']) { case 'title': $newField['title'] = true; @@ -81,15 +81,15 @@ public function __construct($api, $appId = -1) { $newField['state'] = true; $stateValues = array(); // we'll create an anonymous function there to be able to show the state-values since we need to get the options into the template somehow and afaik mustache does not support multiple iterations within each other - + // store new function to return array of values $this->fieldStateFunctions[$field['field_id']] = create_function('$arg', 'return new ArrayIterator($arg);'); - + // create temporary array with given values foreach ($field['config']['settings']['allowed_values'] as $key => $value) { $stateValues[] = array("item" => $value); } - + // create variable (usable via {{#state_values_field_id}} {{item}} {{/state_values_field_id}}) in mustache $newField['state_values_field_id'] = $this->fieldStateFunctions[$field['field_id']]($stateValues); unset($stateValues); @@ -111,10 +111,10 @@ public function __construct($api, $appId = -1) { // get space members $memberValues = array(); // we'll create an anonymous function there to be able to show the state-values since we need to get the options into the template somehow and afaik mustache does not support multiple iterations within each other - + // store new function to return array of values $this->fieldStateFunctions[$field['field_id']] = create_function('$arg', 'return new ArrayIterator($arg);'); - + // create temporary array with given values $members = $api->space->getMembers($app['space_id']); if (count($members) > 0) { @@ -129,11 +129,11 @@ public function __construct($api, $appId = -1) { $newField['values'][$member['user']['user_id']]['avatar'] = $member['user']['avatar'];*/ } } - + // create variable (usable via {{#state_values_field_id}} {{item}} {{/state_values_field_id}}) in mustache $newField['member_values_field_id'] = $this->fieldStateFunctions[$field['field_id']]($memberValues); unset($memberValues); - + break; case 'money': $newField['money'] = true; @@ -150,7 +150,7 @@ public function __construct($api, $appId = -1) { break; } //print_r($newField); - + $this->fields[] = $newField; } } @@ -159,21 +159,21 @@ public function field () { $f = new ArrayIterator($this->fields); return $f; } - + public function notEmpty() { return !($this->isEmpty()); } - + public function isEmpty() { return count($this->fields) === 0; } - + public function appName() { return $this->app['item_name']; } - + public function appIcon() { return $this->app['icon']; } - + } \ No newline at end of file diff --git a/controllers/login.php b/controllers/login.php index ed090d2..297c528 100644 --- a/controllers/login.php +++ b/controllers/login.php @@ -4,9 +4,9 @@ class login extends Mustache { public $APP_NAME = APP_NAME; public $APP_ROOT_URL = APP_ROOT_URL; public $GOOGLE_ANALYTICS_ID = false; - + public $message = null; - + public function __construct ($aApp, $message = null) { if (isset($aApp['google_analytics_id'])) { $this->GOOGLE_ANALYTICS_ID = $aApp['google_analytics_id']; diff --git a/controllers/status.php b/controllers/status.php index 45c179d..21a36e8 100644 --- a/controllers/status.php +++ b/controllers/status.php @@ -4,17 +4,17 @@ class status extends Mustache { public $APP_NAME = APP_NAME; public $APP_ROOT_URL = APP_ROOT_URL; public $PODIO_ICON_PATH = PODIO_ICON_PATH; - + public $GOOGLE_ANALYTICS_ID = false; - + private $feedback = array(); - + public function __construct($aApp) { - + if (isset($aApp['google_analytics_id'])) { $this->GOOGLE_ANALYTICS_ID = $aApp['google_analytics_id']; } - + $oauthForStatus = PodioOAuth::instance(); $baseStatusAPI = PodioBaseAPI::instance($aApp['podio']['server'], $aApp['podio']['client_id'], $aApp['podio']['client_secret'], $aApp['podio']['upload_end_point']); $baseStatusAPI->setLogHandler('file', PODIO_ERROR_LOG, ''); @@ -22,13 +22,13 @@ public function __construct($aApp) { $statusApi = new PodioAPI(); $feedbackAppId = 38098; $feedbackAppSortFieldId = 959376; - + $items = $statusApi->item->getItems($feedbackAppId, 10000, 0, $feedbackAppSortFieldId, 1, array()); - + foreach ($items['items'] as $index => $item) { $status = null; $description = null; - + foreach ($item['fields'] as $field) { if ($field['external_id'] == "status") { $status = $field['values'][0]['value']; @@ -41,12 +41,12 @@ public function __construct($aApp) { $this->feedback[$index]['title'] = $item['title']; $this->feedback[$index]['description'] = $description; } - + } - + public function feedback () { $f = new ArrayIterator($this->feedback); return $f; } - + } \ No newline at end of file diff --git a/css/core.css b/css/core.css index c6e7dec..958c29e 100644 --- a/css/core.css +++ b/css/core.css @@ -224,7 +224,7 @@ input[type="button"]:focus, input[type="submit"]:focus, button:focus, textarea:focus { - border:1px solid #aaa; + border:1px solid #aaa; color: #000; } @@ -233,7 +233,7 @@ input[type="button"]:hover, input[type="submit"]:hover, button:hover, textarea:hover { - border:1px solid #aaa; + border:1px solid #aaa; } input[type="button"],input[type="submit"], button { @@ -331,14 +331,14 @@ div.wrapper { #unFavApp img, #favApp img { filter:alpha(opacity=50); - -moz-opacity: 0.5; + -moz-opacity: 0.5; opacity: 0.5; } #unFavApp:hover img, #favApp:hover img { filter:alpha(opacity=100); - -moz-opacity: 1; + -moz-opacity: 1; opacity: 1; } @@ -479,4 +479,4 @@ body.install p span { @media only screen and (max-width: 480px), only screen and (max-device-width: 480px) { } - + diff --git a/css/reset.css b/css/reset.css index 4d137c7..3e9d01a 100644 --- a/css/reset.css +++ b/css/reset.css @@ -1,8 +1,8 @@ -/* +/* html5doctor.com Reset Stylesheet v1.6.1 Last Updated: 2010-09-17 -Author: Richard Clark - http://richclarkdesign.com +Author: Richard Clark - http://richclarkdesign.com Twitter: @rich_clark */ @@ -15,7 +15,7 @@ b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, figcaption, figure, +article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin:0; @@ -32,7 +32,7 @@ body { } article,aside,details,figcaption,figure, -footer,header,hgroup,menu,nav,section { +footer,header,hgroup,menu,nav,section { display:block; } @@ -68,7 +68,7 @@ ins { /* change colours to suit your needs */ mark { background-color:#ff9; - color:#000; + color:#000; font-style:italic; font-weight:bold; } @@ -91,7 +91,7 @@ table { hr { display:block; height:1px; - border:0; + border:0; border-top:1px solid #cccccc; margin:1em 0; padding:0; diff --git a/css/tokeninput.css b/css/tokeninput.css index ac63e4e..47e6f37 100644 --- a/css/tokeninput.css +++ b/css/tokeninput.css @@ -1,8 +1,8 @@ /* @override http://shodio.l/css/tokeninput.css */ ul.token-input-list { - /*overflow: hidden; - height: auto !important; + /*overflow: hidden; + height: auto !important; height: 1%; width: 400px; border: 1px solid #8496ba; diff --git a/external/helper.php b/external/helper.php index ad82781..ad102c0 100644 --- a/external/helper.php +++ b/external/helper.php @@ -6,7 +6,7 @@ function esc($string) { /** * getView returns mustache template as string - * + * * @param string $classname which template to load * @return template as string * @author Fabian diff --git a/external/podio-php/PodioAPI.php b/external/podio-php/PodioAPI.php index 3350ba8..203120b 100644 --- a/external/podio-php/PodioAPI.php +++ b/external/podio-php/PodioAPI.php @@ -32,7 +32,7 @@ require_once('integration/integration.class.inc.php'); /** - * Primary Podio API implementation class. This is merely a container for + * Primary Podio API implementation class. This is merely a container for * the specific API areas. */ class PodioAPI { @@ -171,7 +171,7 @@ public function __construct() { * A Singleton class that handles all communication with the API server. */ class PodioBaseAPI { - + /** * URL for the API server */ @@ -232,9 +232,9 @@ private function __construct($url, $client_id, $client_secret, $upload_end_point ); $this->error_handler = NULL; } - + /** - * Constructor for the singleton instance. Call with parameters first time, + * Constructor for the singleton instance. Call with parameters first time, * call without parameters subsequent times. * * @param $url URL for the API server @@ -251,7 +251,7 @@ public static function instance($url = '', $client_id = '', $client_secret = '', } return self::$instance; } - + /** * Set the API error handler. * @@ -260,7 +260,7 @@ public static function instance($url = '', $client_id = '', $client_secret = '', public function setErrorHandler($handler) { $this->error_handler = $handler; } - + /** * Log a message to the API log * @@ -272,7 +272,7 @@ public function log($message, $level = PEAR_LOG_INFO) { $logger = &Log::singleton($this->log_handler, $this->log_name, $this->log_ident); $logger->log('[api] ' . $message, $level); } - + /** * Set the log handler for the API log. See: * http://www.indelible.org/php/Log/guide.html#configuring-a-handler @@ -285,7 +285,7 @@ public function setLogHandler($handler, $name, $ident) { $this->log_name = $name; $this->log_ident = $ident; } - + /** * Get the current log level for an area. * @@ -299,7 +299,7 @@ public function setLogHandler($handler, $name, $ident) { public function getLogLevel($name) { return $this->log_levels[$name]; } - + /** * Set the current log level for an area. * @param $name Area to set. Can be: @@ -313,42 +313,42 @@ public function getLogLevel($name) { public function setLogLevel($name, $value) { $this->log_levels[$name] = $value; } - + /** * Get the current API server URL */ public function getUrl() { return $this->url; } - + /** * Get the OAuth client id */ public function getClientId() { return $this->client_id; } - + /** * Get the OAuth client secret */ public function getClientSecret() { return $this->secret; } - + /** * Get the last error message from the API server */ public function getError() { return $this->last_error; } - + /** * Get the last error status code from the API server */ public function getErrorStatusCode() { return $this->last_error_status_code; } - + /** * Normalize filters for GET requests */ @@ -383,7 +383,7 @@ public function normalizeFilters($filters) { } return $data; } - + /** * Upload a file for later use. * @@ -404,25 +404,25 @@ public function upload($file, $name) { $request->setHeader('User-Agent', 'Podio API Client/1.0'); $request->setHeader('Accept', 'application/json'); $request->setHeader('Authorization', 'OAuth2 '.$oauth->access_token); - + $request->addUpload('file', $file); $request->addPostParameter('name', $name); try { $response = $request->send(); switch ($response->getStatus()) { - case 200 : - case 201 : - case 204 : + case 200 : + case 201 : + case 204 : return json_decode($response->getBody(), TRUE); break; - case 401 : - case 400 : - case 403 : - case 404 : - case 410 : - case 500 : - case 503 : + case 401 : + case 400 : + case 403 : + case 404 : + case 410 : + case 500 : + case 503 : if ($this->getLogLevel('error')) { $this->log($request->getMethod() .' '. $response->getStatus().' '.$response->getReasonPhrase().' '.$request->getUrl(), PEAR_LOG_WARNING); $this->log($response->getBody(), PEAR_LOG_WARNING); @@ -431,7 +431,7 @@ public function upload($file, $name) { $this->last_error_status_code = $response->getStatus(); return FALSE; break; - default : + default : break; } } catch (HTTP_Request2_Exception $e) { @@ -440,7 +440,7 @@ public function upload($file, $name) { } } } - + /** * Build and perform an API request. * @@ -456,7 +456,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { 'ssl_verify_peer' => false, 'ssl_verify_host' => false )); - + $request->setConfig('use_brackets', FALSE); $request->setConfig('follow_redirects', TRUE); $request->setHeader('User-Agent', 'Podio API Client/1.0'); @@ -466,7 +466,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { $request->setHeader('X-Podio-Frontend-Token', $this->frontend_token); } $location = $request->getUrl(); - + // These URLs can be called without an access token. $no_token_list = array( '@^/$@', @@ -488,7 +488,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { '@^/app_store/org/[\w]+/$@', '@^/app_store/org/[\w]+/profile$@', ); - + $is_on_no_token_list = FALSE; foreach ($no_token_list as $regex) { if (preg_match($regex, $url)) { @@ -496,7 +496,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { break; } } - + if (!($url == '/user/' && $method == HTTP_Request2::METHOD_POST) && !$is_on_no_token_list) { if (!$oauth->access_token && !(substr($url, 0, 6) == '/file/' && substr($url, -9) == '/location')) { return FALSE; @@ -505,9 +505,9 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { if ($oauth->access_token) { $request->setHeader('Authorization', 'OAuth2 '.$oauth->access_token); } - + switch ($method) { - case HTTP_Request2::METHOD_GET : + case HTTP_Request2::METHOD_GET : $request->setHeader('Content-type', 'application/x-www-form-urlencoded'); if (is_array($data)) { foreach ($data as $key => $value) { @@ -515,7 +515,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { } } break; - case HTTP_Request2::METHOD_DELETE : + case HTTP_Request2::METHOD_DELETE : $request->setHeader('Content-type', 'application/x-www-form-urlencoded'); if (is_array($data)) { foreach ($data as $key => $value) { @@ -523,12 +523,12 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { } } break; - case HTTP_Request2::METHOD_POST : - case HTTP_Request2::METHOD_PUT : + case HTTP_Request2::METHOD_POST : + case HTTP_Request2::METHOD_PUT : $request->setHeader('Content-type', 'application/json'); $request->setBody(json_encode($data)); break; - default : + default : break; } @@ -543,19 +543,19 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { try { $response = $request->send(); switch ($response->getStatus()) { - case 200 : + case 200 : return $response; break; - case 201 : + case 201 : // Only POST requests can result in 201 Created. if ($request->getMethod() == HTTP_Request2::METHOD_POST) { return $response; } break; - case 204 : + case 204 : return $response; break; - case 401 : + case 401 : $body = json_decode($response->getBody(), TRUE); if (strstr($body['error_description'], 'expired_token')) { if ($oauth->refresh_token) { @@ -589,7 +589,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { $oauth->throwError('invalid_token', 'Invalid token.'); } break; - case 400 : + case 400 : $body = json_decode($response->getBody(), TRUE); if (strstr($body['error'], 'invalid_grant')) { $oauth = PodioOAuth::instance(); @@ -599,9 +599,9 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { $oauth->throwError('invalid_grant', 'Invalid grant.'); break; } - case 403 : - case 404 : - case 410 : + case 403 : + case 404 : + case 410 : if ($this->getLogLevel('error')) { $this->log($request->getMethod() .' '. $response->getStatus().' '.$response->getReasonPhrase().' '.$request->getUrl(), PEAR_LOG_WARNING); $this->log($response->getBody(), PEAR_LOG_WARNING); @@ -610,22 +610,22 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { $this->last_error_status_code = $response->getStatus(); return FALSE; break; - case 500 : - case 502 : - case 503 : - case 504 : + case 500 : + case 502 : + case 503 : + case 504 : if ($this->getLogLevel('error')) { $this->log($request->getMethod() .' '. $response->getStatus().' '.$response->getReasonPhrase().' '.$request->getUrl(), PEAR_LOG_WARNING); $this->log($response->getBody(), PEAR_LOG_WARNING); } $this->last_error = json_decode($response->getBody(), TRUE); $this->last_error_status_code = $response->getStatus(); - + // Throw API error $this->throwError($response); return FALSE; break; - default : + default : break; } } catch (HTTP_Request2_Exception $e) { @@ -634,7 +634,7 @@ public function request($url, $data = '', $method = HTTP_Request2::METHOD_GET) { } } } - + /** * Throws an API error. If an error callback is defined it will be called. */ @@ -643,5 +643,5 @@ public function throwError($response) { call_user_func($this->error_handler, $response); } } - + } diff --git a/external/podio-php/PodioOAuth.php b/external/podio-php/PodioOAuth.php index cae9c1b..1be4ce3 100644 --- a/external/podio-php/PodioOAuth.php +++ b/external/podio-php/PodioOAuth.php @@ -7,7 +7,7 @@ * Singleton class for handling OAuth with the Podio API. */ class PodioOAuth { - + private static $instance; /** * The current access token. Used on every API call @@ -29,14 +29,14 @@ class PodioOAuth { private function __construct($error_handler = '') { $this->access_token = ''; $this->refresh_token = ''; - + if ($error_handler) { $this->error_handler = $error_handler; } } /** - * Constructor for the singleton instance. Call with parameters first time, + * Constructor for the singleton instance. Call with parameters first time, * call without parameters subsequent times. * * @param $error_handler A function name to use as the error handler @@ -56,7 +56,7 @@ public static function instance($error_handler = '') { * @param $grant_type The type of request. Can be: * - password: Use username and password to get access token * - refresh token: Refresh expired access token - * - authorization_code: Use the authorization code obtained from step + * - authorization_code: Use the authorization code obtained from step * one of the authorization * @param $data Request data. Varies by grant type. See OAuth specification * @@ -67,7 +67,7 @@ public function getAccessToken($grant_type, $data) { $post_data = array(); $post_data['client_id'] = $api->getClientId(); $post_data['client_secret'] = $api->getClientSecret(); - + switch ($grant_type) { case 'password': $post_data['grant_type'] = 'password'; @@ -86,7 +86,7 @@ public function getAccessToken($grant_type, $data) { default: break; } - + $request = new HTTP_Request2($api->getUrl() . '/oauth/token', HTTP_Request2::METHOD_POST, array( 'ssl_verify_peer' => false, 'ssl_verify_host' => false @@ -102,13 +102,13 @@ public function getAccessToken($grant_type, $data) { foreach ($post_data as $key => $value) { $request->addPostParameter($key, $value); } - + try { $response = $request->send(); switch ($response->getStatus()) { - case 200 : - case 201 : - case 204 : + case 200 : + case 201 : + case 204 : $token = json_decode($response->getBody(), TRUE); if ($token) { $this->access_token = $token['access_token']; @@ -117,13 +117,13 @@ public function getAccessToken($grant_type, $data) { return TRUE; } break; - case 401 : - case 400 : - case 403 : - case 404 : - case 410 : - case 500 : - case 503 : + case 401 : + case 400 : + case 403 : + case 404 : + case 410 : + case 500 : + case 503 : $this->access_token = ''; $this->refresh_token = ''; $this->expires_in = ''; @@ -133,7 +133,7 @@ public function getAccessToken($grant_type, $data) { } return FALSE; break; - default : + default : $this->access_token = ''; $this->refresh_token = ''; $this->expires_in = ''; @@ -146,7 +146,7 @@ public function getAccessToken($grant_type, $data) { } return FALSE; } - + /** * Throws an OAuth error. If an error callback is defined it will be called. */ diff --git a/external/podio-php/README.markdown b/external/podio-php/README.markdown index e1c441d..455c31a 100644 --- a/external/podio-php/README.markdown +++ b/external/podio-php/README.markdown @@ -23,12 +23,12 @@ Before you can make any API calls you need to obtain an OAuth access token. You require_once('/path/to/podio-php/PodioAPI.php'); $oauth = PodioOAuth::instance(); $baseAPI = PodioBaseAPI::instance($server, $client_id, $client_secret, $upload_end_point); - + // Obtain access token $oauth->getAccessToken('password', array('username' => $username, 'password' => $password)); - + print $oauth->access_token; // Your access token - + // Woohoo! Now it's time to make API calls! # Making API calls @@ -37,10 +37,10 @@ To make API calls you use the `PodioAPI` class. This is contains references to a For example: If I want to post a new status message _'Posted from the PHP Client'_ to a space I would call the `create` method in the `status` area like so: $api = new PodioAPI(); - + // $space_id is the id for the space I want to post the status message on $response = $api->status->create($space_id, 'Posted from the PHP Client'); - + if ($response) { print 'The id for the status message is: '.$response['status_id']; } @@ -51,7 +51,7 @@ The Podio API always returns data in JSON and the PHP client automatically decod If you wish to upload a file, for example to status messages, comments, items, widgets etc., you will use the `upload` method in the `api` area: $response = $api->api->upload($path_to_file, $filename_to_display); - + if ($response) { print 'File uploaded. The file id is: '.$response['result']['file_id']; } @@ -72,7 +72,7 @@ The PHP Client is documented using Doxygen. For your convenience a Doxygen confi # Full example: Posting status message with an image require_once('/path/to/podio-php/PodioAPI.php'); - + $server = 'https://api.podio.com:443'; $client_id = 'MY_OAUTH_CLIENT_ID'; $client_secret = 'MY_OAUTH_CLIENT_SECRET'; @@ -80,15 +80,15 @@ The PHP Client is documented using Doxygen. For your convenience a Doxygen confi $oauth = PodioOAuth::instance(); $baseAPI = PodioBaseAPI::instance($server, $client_id, $client_secret, $upload_end_point); - + // Obtain access token $username = 'MY_USERNAME'; $password = 'MY_PASSWORD'; $oauth->getAccessToken('password', array('username' => $username, 'password' => $password)); - + // Upload file $file = $api->api->upload('/path/to/myimage.png', 'myimage.png'); - + // Post status message $space_id = MY_SPACE_ID; $api->status->create($space_id, 'This has an image attached', array((int)$file['result']['file_id'])); diff --git a/external/podio-php/app/app.class.inc.php b/external/podio-php/app/app.class.inc.php index 649ff64..611543c 100644 --- a/external/podio-php/app/app.class.inc.php +++ b/external/podio-php/app/app.class.inc.php @@ -1,9 +1,9 @@ podio = PodioBaseAPI::instance(); } - + /** - * Creates a new app on a space. This creates an empty app. Fields must be + * Creates a new app on a space. This creates an empty app. Fields must be * created manually afterwards. * * @param $space_id The id of the space on which the app is placed @@ -25,36 +25,36 @@ public function __construct() { * - "item_name": The name of each item in an app * - "description": The description of the app * - "usage": Description of how the app should be used - * - "external_id": The external id of the app. This can be used to store an + * - "external_id": The external id of the app. This can be used to store an * id from an external system on the app * - "icon": The name of the icon used to represent the app - * - "allow_edit": True if other members are allowed to edit items from the + * - "allow_edit": True if other members are allowed to edit items from the * app, false otherwise * - "default_view": The default view of the app items on the app main page - * - "allow_attachments": True if attachment of files to an item is allowed, + * - "allow_attachments": True if attachment of files to an item is allowed, * false otherwise - * - "allow_comments": True if members can make comments on an item, + * - "allow_comments": True if members can make comments on an item, * false otherwise - * - "fivestar": True if fivestar rating is enabled on an item, + * - "fivestar": True if fivestar rating is enabled on an item, * false otherwise - * - "fivestar_label": If fivestar rating is enabled, this is the label that + * - "fivestar_label": If fivestar rating is enabled, this is the label that * will be presented to the users * - "approved": True if an item can be approved, false otherwise - * - "thumbs": True if an item can have a thumbs up or thumbs down, + * - "thumbs": True if an item can have a thumbs up or thumbs down, * false otherwise - * - "thumbs_label": If thumbs ratings are enabled, this is the label that + * - "thumbs_label": If thumbs ratings are enabled, this is the label that * will be presented to the users * - "rsvp": True if RSVP is enabled, false otherwise - * - "rsvp_label": If RSVP is enabled, this is the label that will be + * - "rsvp_label": If RSVP is enabled, this is the label that will be * presented to the users * - "yesno": True if yes/no rating is enabled, false otherwise - * - "yesno_label": If yes/no is enabled, this is the label that will be + * - "yesno_label": If yes/no is enabled, this is the label that will be * presented to the users - * - "tasks": A comma separated list of the tasks that will automatically be + * - "tasks": A comma separated list of the tasks that will automatically be * created when a new item is added - * @param $notify True if at the space members should be notified about + * @param $notify True if at the space members should be notified about * this new app, false otherwise - * @param $subscribe True if the space members should be subscribed to this + * @param $subscribe True if the space members should be subscribed to this * new app, false otherwise * * @return Array with new app id @@ -65,13 +65,13 @@ public function create($space_id, $config, $notify, $subscribe) { return json_decode($response->getBody(), TRUE); } } - + /** * Updates the app config. Fields must be updates separately. * * @param $app_id The id of the app to update * @param $config New config array. For options see the 'create' method - * @param $resubscribe True if all space members should be resubscribed to + * @param $resubscribe True if all space members should be resubscribed to * this app, false otherwise */ public function update($app_id, $config, $resubscribe) { @@ -80,7 +80,7 @@ public function update($app_id, $config, $resubscribe) { return json_decode($response->getBody(), TRUE); } } - + /** * Activates a deactivated app. This puts the app back in the app navigator * and allows insertion of new items. @@ -92,7 +92,7 @@ public function activate($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Deactivates the app with the given id. This removes the app from the app * navigator, and disables insertion of new items. @@ -104,9 +104,9 @@ public function deactivate($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Deletes the app with the given id. This will delete all items, widgets, + * Deletes the app with the given id. This will delete all items, widgets, * filters and shares on the app. This operating is not reversible. * * @param $app_id The id of the app to delete @@ -118,7 +118,7 @@ public function delete($app_id) { } } } - + /** * Returns a single field from an app. * @@ -130,9 +130,9 @@ public function getField($app_id, $field_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Gets the definition of an app and can include configuration and fields. + * Gets the definition of an app and can include configuration and fields. * This method will always return the latest revision of the app definition. * * @param $app_id The id of the app to retrieve @@ -142,7 +142,7 @@ public function get($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the apps that the given app depends on. * @@ -157,9 +157,9 @@ public function getDependencies($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns all the active apps on the space along with their dependencies. + * Returns all the active apps on the space along with their dependencies. * The dependencies are only one level deep. * * @param $space_id The id of the space to get apps for @@ -173,18 +173,18 @@ public function getSpaceAppDependencies($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the features that the given apps and optionally space includes. + * Returns the features that the given apps and optionally space includes. * The current list of features are: - * + * * - widgets * - tasks * - filters * * @param $app_ids * A comma-separated list of app ids from which the features should be extracted - * @param $include_space + * @param $include_space * 1 if features from the containing space should be included, 0 otherwise * * @return Array of features @@ -194,9 +194,9 @@ public function getFeatures($app_ids, $include_space) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns all the apps on the space that are visible. The apps are sorted + * Returns all the apps on the space that are visible. The apps are sorted * by any custom ordering and else by name. * * @param $space_id The id of the space to get apps for @@ -208,10 +208,10 @@ public function getSpaceApps($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the apps available for install on the given space. This includes - * all the apps that are visible and allows insert on all the others space + * Returns the apps available for install on the given space. This includes + * all the apps that are visible and allows insert on all the others space * the user is a member of. * * @param $space_id The id of the space to get apps for @@ -223,20 +223,20 @@ public function getAvailableApps($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Gets a list of apps by certain criteria. The apps are sorted by the - * order they were created in, unless apps have been moved manually + * Gets a list of apps by certain criteria. The apps are sorted by the + * order they were created in, unless apps have been moved manually * by a space administrator. * - * @param $type How the results should be returned. "full" will return both + * @param $type How the results should be returned. "full" will return both * config and fields, while "short" will return only the config - * @param $space_ids A comma-separated list of space ids to which the apps + * @param $space_ids A comma-separated list of space ids to which the apps * should belong - * @param $status The status of the app, "active", "inactive" or "deleted". + * @param $status The status of the app, "active", "inactive" or "deleted". * Defaults to "active" * @param $owner_id The id of the owner of the app - * @param $external_id The external id of the app. Can be used to get apps + * @param $external_id The external id of the app. Can be used to get apps * based on an external id from another system * * @return Array of apps. @@ -249,7 +249,7 @@ public function getApps($type, $space_ids, $status = 'active', $owner_id = NULL, if ($external_id) { $data['external_id'] = $external_id; } - + if ($data['space_ids'] == '0') { return FALSE; } @@ -258,11 +258,11 @@ public function getApps($type, $space_ids, $status = 'active', $owner_id = NULL, return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the top apps for the active user. This is the apps that the user + * Returns the top apps for the active user. This is the apps that the user * have interacted with the most. - * + * * @param $limit The maximum number of apps to return, defaults to 4. * * @return Array of apps @@ -272,7 +272,7 @@ public function getTop($limit = 4) { return json_decode($response->getBody(), TRUE); } } - + /** * Adds a new field to an app * @@ -280,7 +280,7 @@ public function getTop($limit = 4) { * @param $type The type of field. See API documentation for possible values * @param $config Array with a config object for the field. Options are: * - "label": The label of the field, which is what the users will see - * - "description": The description of the field, shown to the user when + * - "description": The description of the field, shown to the user when * inserting and editing * - "delta": An integer indicating the order of the field compared to other fields * - "settings": The settings of the field which depends on the type of the field @@ -295,16 +295,16 @@ public function createField($app_id, $type, $config) { return json_decode($response->getBody(), TRUE); } } - + /** - * Updates the configuration of an app field. The type of the field cannot + * Updates the configuration of an app field. The type of the field cannot * be updated, only the configuration. - * + * * @param $app_id The id of the app to edit field on * @param $field_id The id of the field to update * @param $config Array with a config object for the field. Options are: * - "label": The label of the field, which is what the users will see - * - "description": The description of the field, shown to the user when + * - "description": The description of the field, shown to the user when * inserting and editing * - "delta": An integer indicating the order of the field compared to other fields * - "settings": The settings of the field which depends on the type of the field @@ -316,9 +316,9 @@ public function updateField($app_id, $field_id, $config) { return json_decode($response->getBody(), TRUE); } } - + /** - * Updates the order of the apps on the space. It should post all the apps + * Updates the order of the apps on the space. It should post all the apps * from the space in the order required. * * @param $space_id The space to order apps on @@ -330,7 +330,7 @@ public function reorder($space_id, $list) { } return FALSE; } - + /** * Installs the app with the given id on the space. * @@ -344,6 +344,6 @@ public function install($app_id, $space_id) { return json_decode($response->getBody(), TRUE); } } - + } diff --git a/external/podio-php/app_store/app_store.class.inc.php b/external/podio-php/app_store/app_store.class.inc.php index 67e5942..3bdbea6 100644 --- a/external/podio-php/app_store/app_store.class.inc.php +++ b/external/podio-php/app_store/app_store.class.inc.php @@ -1,9 +1,9 @@ podio->request('/app_store/org/' . $organization_url . '/', array('language' => $locale, 'type' => $type, 'limit' => $limit, 'offset' => $offset, 'sort' => $sort))) { return json_decode($response->getBody(), TRUE); } - } + } /** * Searches the app store for apps with the given language and texts. * * @param $words Comma-separated list of texts to search for - * @param $locale The language of the shares to return. English apps will + * @param $locale The language of the shares to return. English apps will * always be returned. - * @param $sort The sorting of the shares, either "install", "rating" or + * @param $sort The sorting of the shares, either "install", "rating" or * "name". Defaults to "name". - * @param $type The type of share to return, either "app", "pack" or + * @param $type The type of share to return, either "app", "pack" or * leave out for both. * @param $limit The maximum number of apps to return. Defaults to 30 * @param $offset The offset to used when returning the apps. @@ -114,11 +114,11 @@ public function search($words, $locale, $sort = 'name', $type = '', $limit = 30, return json_decode($response->getBody(), TRUE); } } - + /** * Returns the categories available in the system. * - * @param $language If specified, only categories with shares in the given + * @param $language If specified, only categories with shares in the given * language will be returned * * @return Array of verticals and function categories @@ -136,7 +136,7 @@ public function getCategories($language = NULL) { /** * Returns all the apps that the active user has shared. * - * @param $type The type of shares to return, either "app" or "pack", leave + * @param $type The type of shares to return, either "app" or "pack", leave * out for all shares * @param $limit The maximum number of shares to return * @param $offset The offset into the list of shares @@ -167,7 +167,7 @@ public function getProfile() { * * @param $share_id Id of the share to install * @param $space_id The id of the space the shared app should be installed to - * @param $dependencies The list of ids of the dependent shares that should + * @param $dependencies The list of ids of the dependent shares that should * also be installed, if not already present */ public function install($share_id, $space_id, $dependencies) { @@ -178,7 +178,7 @@ public function install($share_id, $space_id, $dependencies) { } /** - * Returns the shared app from the app store with the given id. It will + * Returns the shared app from the app store with the given id. It will * also return all comments and fivestar ratings of the app. * * @param $share_id The id of the share to retrieve @@ -275,7 +275,7 @@ public function update($share_id, $abstract, $description, $language, $category_ /** * Unshares the given app from the app store - * + * * @param $share_id The id of the share to unpublish */ public function unshare($share_id) { @@ -290,9 +290,9 @@ public function unshare($share_id) { /** * Returns a random featured app with the given language. * - * @param $language The language of the shares to return. English apps will + * @param $language The language of the shares to return. English apps will * always be returned. - * @param $type The type of share to return, either "app", "pack" or leave + * @param $type The type of share to return, either "app", "pack" or leave * out for both. */ public function getFeatured($language, $type = '') { @@ -305,12 +305,12 @@ public function getFeatured($language, $type = '') { * Returns the app store profile of the organization. * * @param $organization_url The URL of the organization - * + * */ public function getOrganizationProfile($organization_url) { if ($response = $this->podio->request('/app_store/org/' . $organization_url .'/profile', array())) { return json_decode($response->getBody(), TRUE); } - } + } } diff --git a/external/podio-php/bulletin/bulletin.class.inc.php b/external/podio-php/bulletin/bulletin.class.inc.php index 0b84cd6..1b5e600 100644 --- a/external/podio-php/bulletin/bulletin.class.inc.php +++ b/external/podio-php/bulletin/bulletin.class.inc.php @@ -1,9 +1,9 @@ podio = PodioBaseAPI::instance(); } - + /** * Returns all the bulletins * @@ -38,9 +38,9 @@ public function get($bulletin_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Creates a new bulletin with the given title, summary and text. When the + * Creates a new bulletin with the given title, summary and text. When the * bulletin is created, all users will be notified of the new bulletin. * * @param $title The title of the new bulletin @@ -53,7 +53,7 @@ public function create($title, $summary, $text) { return json_decode($response->getBody(), TRUE); } } - + /** * Updates a bulletin to correct mistakes. * @@ -68,5 +68,5 @@ public function update($bulletin_id, $title, $summary, $text) { return json_decode($response->getBody(), TRUE); } } - + } \ No newline at end of file diff --git a/external/podio-php/calendar/calendar.class.inc.php b/external/podio-php/calendar/calendar.class.inc.php index 77e3a4a..254fd2e 100644 --- a/external/podio-php/calendar/calendar.class.inc.php +++ b/external/podio-php/calendar/calendar.class.inc.php @@ -1,10 +1,10 @@ podio = PodioBaseAPI::instance(); } - + /** - * Returns all items that the user have access to and all tasks that are - * assigned to the user. The items and tasks can be filtered by a list + * Returns all items that the user have access to and all tasks that are + * assigned to the user. The items and tasks can be filtered by a list * of space ids, but tasks without a reference will always be returned. * * @param $date_from The date to serach from * @param $date_to The date to search to - * @param $space_ids An optional array of space ids to which the search + * @param $space_ids An optional array of space ids to which the search * should be restricted - * @param $types The types of objects to be included. Valid options are - * "item" and "task". If left blank, all types of objects + * @param $types The types of objects to be included. Valid options are + * "item" and "task". If left blank, all types of objects * will be returned * * @return Array of calendar events @@ -48,15 +48,15 @@ public function getGlobal($date_from, $date_to, $space_ids = NULL, $types = NULL } /** - * Returns all items and tasks that the user have access to in the given - * space. Tasks with reference to other spaces are not returned or tasks + * Returns all items and tasks that the user have access to in the given + * space. Tasks with reference to other spaces are not returned or tasks * with no reference. * * @param $space_id The id of the space to get calendar for * @param $date_from The date to serach from * @param $date_to The date to search to - * @param $types The types of objects to be included. Valid options are - * "item" and "task". If left blank, all types of objects + * @param $types The types of objects to be included. Valid options are + * "item" and "task". If left blank, all types of objects * will be returned * * @return Array of calendar events @@ -70,10 +70,10 @@ public function getSpace($space_id, $date_from, $date_to, $types = NULL) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the items and tasks that are related to the given app - * + * * @param $app_id The id of the app to get events for * @param $date_from The date to serach from * @param $date_to The date to search to diff --git a/external/podio-php/comment/comment.class.inc.php b/external/podio-php/comment/comment.class.inc.php index e55f022..043cfa4 100644 --- a/external/podio-php/comment/comment.class.inc.php +++ b/external/podio-php/comment/comment.class.inc.php @@ -1,10 +1,10 @@ podio = PodioBaseAPI::instance(); } - + /** * Adds a new comment to the object of the given type and id. * @@ -39,9 +39,9 @@ public function create($ref_type, $ref_id, $value, $external_id = NULL, $file_id return json_decode($response->getBody(), TRUE); } } - + /** - * Updates an already created comment. This should only be used to correct + * Updates an already created comment. This should only be used to correct * spelling and grammatical mistakes in the comment. * * @param $comment_id The id of the comment to update @@ -58,9 +58,9 @@ public function update($comment_id, $value, $external_id = NULL, $file_ids = arr return json_decode($response->getBody(), TRUE); } } - + /** - * Deletes a comment made by a user. This can be used to retract a comment + * Deletes a comment made by a user. This can be used to retract a comment * that was made and which the user regrets. * * @param $comment_id The id of the comment to delete @@ -73,10 +73,10 @@ public function delete($comment_id) { return FALSE; } } - + /** - * Used to retrieve all the comments that have been made on an object of - * the given type and with the given id. It returns a list of all the + * Used to retrieve all the comments that have been made on an object of + * the given type and with the given id. It returns a list of all the * comments sorted in ascending order by time created. * * @param $ref_type @@ -89,9 +89,9 @@ public function getComments($ref_type, $ref_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the contents of a comment. It is not possible to see where the + * Returns the contents of a comment. It is not possible to see where the * comment was made, only the comment itself. * * @param $comment_id The id of the comment to retrieve diff --git a/external/podio-php/contact/contact.class.inc.php b/external/podio-php/contact/contact.class.inc.php index e159a7a..5b585e0 100644 --- a/external/podio-php/contact/contact.class.inc.php +++ b/external/podio-php/contact/contact.class.inc.php @@ -1,11 +1,11 @@ podio = PodioBaseAPI::instance(); } - + /** * Returns the total number of contacts by organization. * @@ -40,9 +40,9 @@ public function getContact($user_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns all the contact details about the contact with the + * Returns all the contact details about the contact with the * given profile id. * * @param $profile_id The id of the profile to retrieve @@ -52,13 +52,13 @@ public function getContactV2($profile_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the top contacts for the user ordered by their overall + * Returns the top contacts for the user ordered by their overall * interactive with the active user. - * + * * @param $limit The maximum number of contacts to return, defaults to all. - * @param $type How the contacts should be returned, "mini", "short" + * @param $type How the contacts should be returned, "mini", "short" * or "full". Default is "mini" * * @return Array of contact objects @@ -68,31 +68,31 @@ public function getTopContacts($limit, $type = 'mini') { return json_decode($response->getBody(), TRUE); } } - + /** - * Used to get a list of contacts for the user. Either global or within + * Used to get a list of contacts for the user. Either global or within * a context (space or organization). * * @param $type Context for call. "all", "space" or "org" * @param $ref_id The id of the reference, if any - * @param $contact_type Comma-separated list of contacts to return, - * can be either "user", "connection" or "space". - * Defaults to "user". To get all types of + * @param $contact_type Comma-separated list of contacts to return, + * can be either "user", "connection" or "space". + * Defaults to "user". To get all types of * contacts supply a blank value for the parameter. - * @param $format Determines the way the result is returned. Valid options + * @param $format Determines the way the result is returned. Valid options * are "mini", "short" and "full". Default is "mini". - * @param $order The order in which the contacts can be returned. See the + * @param $order The order in which the contacts can be returned. See the * area for details on the ordering options. * @param $limit The maximum number of contacts that should be returned. * @param $offset he offset to use when returning contacts. - * @param $required An array of fields that should exist for - * the contacts returned. Useful for only getting + * @param $required An array of fields that should exist for + * the contacts returned. Useful for only getting * contacts with an email address or phone number. - * @param $field An array with one key/value pair. The key is name of a - * required field. The value is the value for the field. + * @param $field An array with one key/value pair. The key is name of a + * required field. The value is the value for the field. * For text fields partial matches will be returned. - * @param $exclude_self If set to 1 (the default) the active user will not - * be returned, else the active user can be included + * @param $exclude_self If set to 1 (the default) the active user will not + * be returned, else the active user can be included * in the results. * * @return Array of contact objects @@ -101,7 +101,7 @@ public function getContacts($type = 'all', $ref_id = NULL, $contact_type = 'user if ($type != 'all' && !$ref_id) { return FALSE; } - + if ($type == 'space') { $url = '/contact/space/'.$ref_id; } @@ -118,14 +118,14 @@ public function getContacts($type = 'all', $ref_id = NULL, $contact_type = 'user $requestData['limit'] = $limit; $requestData['contact_type'] = $contact_type; $requestData['exclude_self'] = $exclude_self; - + if ($offset) { $requestData['offset'] = $offset; } if (count($required) > 0) { $requestData['required'] = implode(',', $required); } - + $requestData = array_merge($requestData, $field); if ($response = $this->podio->request($url, $requestData)) { diff --git a/external/podio-php/conversation/conversation.class.inc.php b/external/podio-php/conversation/conversation.class.inc.php index 114987a..3d53e9b 100644 --- a/external/podio-php/conversation/conversation.class.inc.php +++ b/external/podio-php/conversation/conversation.class.inc.php @@ -1,8 +1,8 @@ podio = PodioBaseAPI::instance(); } - + /** - * Gets the conversation including participants and messages with the - * given id. Only participants in the conversation is allowed to view + * Gets the conversation including participants and messages with the + * given id. Only participants in the conversation is allowed to view * the conversation. * * @param $conversation_id The id of the conversation @@ -29,7 +29,7 @@ public function get($conversation_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns a list of all the conversations on the object that the active user is part of. * @@ -44,15 +44,15 @@ public function getConversationOnObject($ref_type, $ref_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Creates a new conversation with a list of users. Once a conversation is + * Creates a new conversation with a list of users. Once a conversation is * started, the participants cannot (yet) be changed. * * @param $subject The subject of the conversation * @param $text The body of the first message in the conversation * @param $participants Array of user ids in the conversation - * @param $ref_type If conversation is on an object, the type, + * @param $ref_type If conversation is on an object, the type, * blank otherwise * @param $ref_id The id of the reference object */ @@ -66,7 +66,7 @@ public function create($subject, $text, $participants, $ref_type = NULL, $ref_id return json_decode($response->getBody(), TRUE); } } - + /** * Creates a reply to the conversation. * diff --git a/external/podio-php/file/file.class.inc.php b/external/podio-php/file/file.class.inc.php index 3c60254..01a4e77 100644 --- a/external/podio-php/file/file.class.inc.php +++ b/external/podio-php/file/file.class.inc.php @@ -1,9 +1,9 @@ podio = PodioBaseAPI::instance(); } - + /** * Returns all the files on the space order by the file name. * * @param $space_id Space id of the space wanted - * @param $limit The maximum number of files to be returned. + * @param $limit The maximum number of files to be returned. * Defaults to 50 and cannot be higher than 100 - * @param $offset The offset to use when returning files to be used + * @param $offset The offset to use when returning files to be used * for pagination. Defaults to 0 (no offset) * * @return Array of file objects @@ -33,11 +33,11 @@ public function getFilesOnSpace($space_id, $limit, $offset = 0) { } /** - * Returns the latest files on the space order descending by the date the + * Returns the latest files on the space order descending by the date the * file was uploaded. * * @param $space_id Space id of the space wanted - * @param $limit The maximum number of files to be returned. + * @param $limit The maximum number of files to be returned. * Defaults to 10 and cannot be higher than 50 * * @return Array of file objects @@ -49,7 +49,7 @@ public function getRecentOnSpace($space_id, $limit) { } /** - * Returns the name, mimetype and location of the file. + * Returns the name, mimetype and location of the file. * This is only used for the download script. * * @param $file_id Id for the file @@ -59,7 +59,7 @@ public function getLocation($file_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Deletes the file with the given id. * @@ -73,15 +73,15 @@ public function delete($file_id) { } /** - * Attaches the uploaded file to the given object. + * Attaches the uploaded file to the given object. * Valid objects are "status", "item" and "comment". * * @param $file_id Id of the file to attach - * @param $ref_type Type of reference to attach to. + * @param $ref_type Type of reference to attach to. * Can be "status", "item" or "comment" * @param $ref_id Status id, item id or comment id */ - public function attach($file_id, $ref_type, $ref_id) { + public function attach($file_id, $ref_type, $ref_id) { $data['ref_type'] = $ref_type; $data['ref_id'] = (int)$ref_id; $response = $this->podio->request('/file/'.$file_id.'/attach', $data, HTTP_Request2::METHOD_POST); @@ -90,11 +90,11 @@ public function attach($file_id, $ref_type, $ref_id) { } return FALSE; } - + /** - * Upload a new temporary file. After upload the file can either be attached - * directly to a file using the attach operation, used to replace an - * existing file using the replace operation or used as file id when + * Upload a new temporary file. After upload the file can either be attached + * directly to a file using the attach operation, used to replace an + * existing file using the replace operation or used as file id when * posting a new object. * * @param $name The name of the file @@ -104,17 +104,17 @@ public function attach($file_id, $ref_type, $ref_id) { */ public function create($name, $mimetype) { $data['name'] = $name; - $data['mimetype'] = $mimetype; + $data['mimetype'] = $mimetype; $response = $this->podio->request('/file/', $data, HTTP_Request2::METHOD_POST); if ($response) { return json_decode($response->getBody(), TRUE); } return FALSE; } - + /** - * Marks the file as available on the location given when the file was - * registered. This will cause the thumbnails to be generated + * Marks the file as available on the location given when the file was + * registered. This will cause the thumbnails to be generated * and available. * * @param $file_id The id of the file to announce @@ -126,12 +126,12 @@ public function announceAvailable($file_id) { } return FALSE; } - + /** - * Marks the current file as an replacement for the old file. Only files + * Marks the current file as an replacement for the old file. Only files * with type of "attachment" can be replaced. * - * @param $old_file_id The id of the old file that should be + * @param $old_file_id The id of the old file that should be * replacd with the new file * @param $new_file_id The id of the current file */ diff --git a/external/podio-php/filter/filter.class.inc.php b/external/podio-php/filter/filter.class.inc.php index a5e3434..ca2c753 100644 --- a/external/podio-php/filter/filter.class.inc.php +++ b/external/podio-php/filter/filter.class.inc.php @@ -4,9 +4,9 @@ * Filtering can be used to limit the items returned when viewing an app. * * There are two types of filters: - * - Saved filters which are filters a user have saved for future reuse + * - Saved filters which are filters a user have saved for future reuse * by the user or other members of the space. - * - Last used filters, which stores the filter which was last used by + * - Last used filters, which stores the filter which was last used by * the user on the given app. */ class PodioFilterAPI { @@ -35,7 +35,7 @@ public function create($app_id, $name, $sort_by, $sort_desc = FALSE, $filters = return json_decode($response->getBody(), TRUE); } } - + /** * Returns the definition for the given filter. * @@ -48,9 +48,9 @@ public function get($filter_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the last filter used by the active user on the given app. + * Returns the last filter used by the active user on the given app. * If there was no last filter, the default filter is returned. * * @param $app_id The app to get filter for @@ -62,7 +62,7 @@ public function getLast($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the filters on the given app. * @@ -75,7 +75,7 @@ public function getForApp($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Deletes the given filter * diff --git a/external/podio-php/form/form.class.inc.php b/external/podio-php/form/form.class.inc.php index 24f41bf..52fe1bc 100644 --- a/external/podio-php/form/form.class.inc.php +++ b/external/podio-php/form/form.class.inc.php @@ -1,8 +1,8 @@ getBody(), TRUE); } } - + /** * Updates the form with new settings, domains, fields, etc. * * @param $form_id The id of the form to update * @param $settings The settings for the form. An array with these keys: * - "captcha": True if captcha is enabled, false otherwise - * - "text": The texts used for the form. Array with two keys: + * - "text": The texts used for the form. Array with two keys: * - "submit": The text for the submit button * - "success": The text when the form was successfully submitted * - "theme": The theme to use. Options: @@ -60,7 +60,7 @@ public function create($app_id, $settings, $domains, $field_ids, $attachments) { * - classic * - dark * @param $domains Array of domains where the form can be used - * @param $field_ids Array of ids of the fields that should be + * @param $field_ids Array of ids of the fields that should be * active for the form * @param $attachments True if attachments are allowed, false otherwise */ @@ -70,7 +70,7 @@ public function update($form_id, $settings, $domains, $field_ids, $attachments) return json_decode($response->getBody(), TRUE); } } - + /** * Returns the form with the given id. * @@ -81,7 +81,7 @@ public function get($form_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns all the active forms on the given app. * @@ -94,7 +94,7 @@ public function getForms($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Deletes the form with the given id. * diff --git a/external/podio-php/integration/integration.class.inc.php b/external/podio-php/integration/integration.class.inc.php index ab52825..d253931 100644 --- a/external/podio-php/integration/integration.class.inc.php +++ b/external/podio-php/integration/integration.class.inc.php @@ -22,7 +22,7 @@ public function get($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Refreshes the integration. This will update all items in the background. * diff --git a/external/podio-php/item/item.class.inc.php b/external/podio-php/item/item.class.inc.php index db9d056..530936a 100644 --- a/external/podio-php/item/item.class.inc.php +++ b/external/podio-php/item/item.class.inc.php @@ -1,11 +1,11 @@ getBody(), TRUE); } } - + /** - * Returns the recent activity on the app divided into activity today and - * activity the last week. The activity events are ordered descending by + * Returns the recent activity on the app divided into activity today and + * activity the last week. The activity events are ordered descending by * the time the events occurred. * * @param $app_id The id of the app to get activity for @@ -44,13 +44,13 @@ public function getActivity($app_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Used to find possible items for a given application field. It searches + * Used to find possible items for a given application field. It searches * the relevant items for the title given. - * + * * @param $field_id Id of the app field that is being searched - * @param $text The text to search for. The search will be lower case, + * @param $text The text to search for. The search will be lower case, * and with a wildcard in each end. * * @return Array of items @@ -60,9 +60,9 @@ public function searchField($field_id, $text) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the top possible values for the given field. + * Returns the top possible values for the given field. * This is currently only valid for fields of type "app". * * @param $field_id The id of the field to get top values for @@ -73,7 +73,7 @@ public function getFieldTop($field_id, $limit = 8) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the item with the specified id. * @@ -91,7 +91,7 @@ public function get($item_id) { } /** - * Gets the basic details about the given item. Similar to the full get + * Gets the basic details about the given item. Similar to the full get * item method, but only returns data for the item itself. * * @param $item_id The id of the item to retrieve @@ -106,14 +106,14 @@ public function getBasic($item_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the previous item relative to the given item. This takes into + * Returns the previous item relative to the given item. This takes into * consideration the last used filter on the app. * * @param $item_id The id of the current item - * @param $time Optional. The time to base the filtering on. Set this to - * get the previous item based on the filtering and ordering + * @param $time Optional. The time to base the filtering on. Set this to + * get the previous item based on the filtering and ordering * of items at the given time. * * @return Array with item id and title @@ -126,12 +126,12 @@ public function getPrevious($item_id, $time = NULL) { } /** - * Returns the next item after the given item id. This takes into + * Returns the next item after the given item id. This takes into * consideration the last used filter on the app. * * @param $item_id The id of the current item - * @param $time Optional. The time to base the filtering on. Set this to - * get the next item based on the filtering and ordering of + * @param $time Optional. The time to base the filtering on. Set this to + * get the next item based on the filtering and ordering of * items at the given time. * * @return Array with item id and title @@ -149,21 +149,21 @@ public function getNext($item_id, $time = NULL) { * @param $app_id The id of the app to get items from * @param $limit The maximum number of items to receive * @param $offset The offset from the start of the items returned - * @param $sort_by How the items should be sorted. For the possible options, + * @param $sort_by How the items should be sorted. For the possible options, * see the filter area. - * @param $sort_desc Use 1 or leave out to sort descending, + * @param $sort_desc Use 1 or leave out to sort descending, * use 0 to sort ascending - * @param $filters Array of key/value pairs to use for filtering. For the - * valid keys and values see the filter area. For list - * filtering, the values are given as a comma-separated + * @param $filters Array of key/value pairs to use for filtering. For the + * valid keys and values see the filter area. For list + * filtering, the values are given as a comma-separated * list, for range filtering the values are given as "x-y". * - * @return Array with the total count and filtered count for the results and + * @return Array with the total count and filtered count for the results and * an array of items */ public function getItems($app_id, $limit, $offset, $sort_by, $sort_desc, $filters = array()) { $data = array('limit' => $limit, 'offset' => $offset, 'sort_by' => $sort_by, 'sort_desc' => $sort_desc); - + $normalized_filters = $this->podio->normalizeFilters($filters); foreach ($normalized_filters as $key => $value) { $data[$key] = $value; @@ -212,15 +212,15 @@ public function getRevisionDiff($item_id, $from, $to) { * @param $fields Array of values for each field. Each item has three keys: * - "field_id" : The id of the field (field_id or external_id must * be specified) - * - "external_id" : The external id of the field (field_id or external_id + * - "external_id" : The external id of the field (field_id or external_id * must be specified) * - "values" : Array. The values for the field - * @param $file_ids Array. Temporary files that have been uploaded and + * @param $file_ids Array. Temporary files that have been uploaded and * should be attached to this item * @param $tags Array of tags to put on the item - * @param $external_id The external id of the item. This can be used to + * @param $external_id The external id of the item. This can be used to * hold a reference to the item in an external system - * @param $silent Set to 1 if the operating should not result in + * @param $silent Set to 1 if the operating should not result in * stream events and notifications * * @return Array with the new item id @@ -235,20 +235,20 @@ public function create($app_id, $fields, $file_ids = array(), $tags = array(), $ return json_decode($response->getBody(), TRUE); } } - + /** - * Update an already existing item. Values will only be updated for fields - * included. To delete all values for a field supply an empty array as + * Update an already existing item. Values will only be updated for fields + * included. To delete all values for a field supply an empty array as * values for that field. * * @param $item_id The id of the item that's being updated * @param $fields Array of values for each field. Each item has two keys: * - "field_id" : The id of the field (field_id or external_id must * be specified) - * - "external_id" : The external id of the field (field_id or external_id + * - "external_id" : The external id of the field (field_id or external_id * must be specified) * - "values" : Array. The values for the field - * @param $revision The revision of the item that is being updated. + * @param $revision The revision of the item that is being updated. * This is optional. */ public function update($item_id, $fields, $revision = NULL) { @@ -263,9 +263,9 @@ public function update($item_id, $fields, $revision = NULL) { return FALSE; } } - + /** - * Deletes an item and removes it from all views. + * Deletes an item and removes it from all views. * The data can no longer be retrieved. * * @param $item_id Id of the item to delete @@ -278,14 +278,14 @@ public function delete($item_id) { return FALSE; } } - + /** * Update the item values for a specific field. * * @param $item_id The id of the item to update * @param $field_id The id of the field to update * @param $data Array of new values - * @param $silent Set to 1 if the operating should not result in + * @param $silent Set to 1 if the operating should not result in * stream events and notifications */ public function updateFieldValue($item_id, $field_id, $data, $silent = 0) { @@ -297,19 +297,19 @@ public function updateFieldValue($item_id, $field_id, $data, $silent = 0) { return json_decode($response->getBody(), TRUE); } } - + /** - * Performs a calculation on the given app. The calculation is made up - * of 4 parts; aggreation, formula, grouping and filtering. See the API + * Performs a calculation on the given app. The calculation is made up + * of 4 parts; aggreation, formula, grouping and filtering. See the API * documentation for detals. * * @param $app_id The id of the app to perform calculation on. - * @param $aggregation The type of aggregation, either "sum", "average", + * @param $aggregation The type of aggregation, either "sum", "average", * "count", "mininum" or "maximum" * @param $filters Filters to apply. See filter area. - * @param $formula An array of formula parts. Each part is an array with + * @param $formula An array of formula parts. Each part is an array with * two keys: "type" and "value" - * @param $grouping The group to be applied. See method documentation + * @param $grouping The group to be applied. See method documentation * for details * @param $limit The maximum number of results to return, defaults to 15 */ @@ -327,30 +327,30 @@ public function calculate($app_id, $aggregation, $filters = array(), $formula = return json_decode($response->getBody(), TRUE); } } - + /** * Returns a CSV file with the following options: - * + * * - Header row * - UTF-8 encoding * - "," delimiter * - carriage return and line-feed line terminator * - Double quoting with quoting only used when needed - * First two columns are "Created on" and "Created by". + * First two columns are "Created on" and "Created by". * The remaining columns are the fields on the app. - * + * * @param $app_id The id of the app to get items from - * @param $format Use "windows" to get the windows format, + * @param $format Use "windows" to get the windows format, * something else for any other format. * @param $limit The maximum number of items to receive * @param $offset The offset from the start of the items returned - * @param $sort_by How the items should be sorted. For the possible options, + * @param $sort_by How the items should be sorted. For the possible options, * see the filter area. - * @param $sort_desc Use 1 or leave out to sort descending, + * @param $sort_desc Use 1 or leave out to sort descending, * use 0 to sort ascending - * @param $filters Array of key/value pairs to use for filtering. For the - * valid keys and values see the filter area. For list - * filtering, the values are given as a comma-separated + * @param $filters Array of key/value pairs to use for filtering. For the + * valid keys and values see the filter area. For list + * filtering, the values are given as a comma-separated * list, for range filtering the values are given as "x-y". * * @return Array with three keys: @@ -378,17 +378,17 @@ function csv($app_id, $format, $limit, $offset, $sort_by, $sort_desc, $filters = /** * Returns a XLSX file of items - * + * * @param $app_id The id of the app to get items from * @param $limit The maximum number of items to receive * @param $offset The offset from the start of the items returned - * @param $sort_by How the items should be sorted. For the possible options, + * @param $sort_by How the items should be sorted. For the possible options, * see the filter area. - * @param $sort_desc Use 1 or leave out to sort descending, + * @param $sort_desc Use 1 or leave out to sort descending, * use 0 to sort ascending - * @param $filters Array of key/value pairs to use for filtering. For the - * valid keys and values see the filter area. For list - * filtering, the values are given as a comma-separated + * @param $filters Array of key/value pairs to use for filtering. For the + * valid keys and values see the filter area. For list + * filtering, the values are given as a comma-separated * list, for range filtering the values are given as "x-y". * * @return Array with three keys: diff --git a/external/podio-php/notification/notification.class.inc.php b/external/podio-php/notification/notification.class.inc.php index 72e7778..f42a10e 100644 --- a/external/podio-php/notification/notification.class.inc.php +++ b/external/podio-php/notification/notification.class.inc.php @@ -1,9 +1,9 @@ getBody(), TRUE); } } - + /** - * Returns the notifications in the inbox that has already been viewed. - * The notifications are sorted in descending order, either by viewed time + * Returns the notifications in the inbox that has already been viewed. + * The notifications are sorted in descending order, either by viewed time * or creation time. * - * @param $limit The limit on the number of notifications to return, + * @param $limit The limit on the number of notifications to return, * default is 10 * @param $offset The offset on the notifications to return, default is 0 - * @param $date_type The type of date to use for sorting and filtering. - * Can be either "created" or "viewed". + * @param $date_type The type of date to use for sorting and filtering. + * Can be either "created" or "viewed". * Default is "created" * @param $types Array of the types of notifications to see in the inbox * @param $date_from The earliest date to get notifications from @@ -96,21 +96,21 @@ public function getViewed($limit, $offset = 0, $date_type = 'created', $types = if($users) { $data['users'] = implode(',', $users); } - + $response = $this->podio->request('/notification/inbox/viewed', $data); if ($response) { return json_decode($response->getBody(), TRUE); } - } - + } + /** * Return the top filter options for the inbox viewed. * - * @param $limit The limit on how many filters of each type + * @param $limit The limit on how many filters of each type * should be returned - * @param $date_type Which kind of date should be used for the date + * @param $date_type Which kind of date should be used for the date * filtering, can be either "created" or "viewed" - * @param $sent 1 if only sent notifications should be + * @param $sent 1 if only sent notifications should be * used, 0 otherwise * * @return Array of "months" and "users" available for filtering @@ -131,7 +131,7 @@ public function getFiltersAndCounts($limit = NULL, $date_type = NULL, $sent = NU return json_decode($response->getBody(), TRUE); } } - + /** * Mark the notification as viewed or unviewed. * @@ -154,7 +154,7 @@ public function markViewed($notification_id, $viewed) { public function markAllViewed() { $response = $this->podio->request('/notification//viewed', array(), HTTP_Request2::METHOD_POST); } - + /** * Returns the notification settings for the active user */ @@ -164,7 +164,7 @@ public function getSettings() { return json_decode($response->getBody(), TRUE); } } - + /** * Updates the direct notification settings for the user * @@ -174,7 +174,7 @@ public function setSetting($send_notifications) { $data['direct'] = $send_notifications; $response = $this->podio->request('/notification/settings', $data, HTTP_Request2::METHOD_PUT); } - + /** * Updates the digest notification settings for the user * diff --git a/external/podio-php/org/org.class.inc.php b/external/podio-php/org/org.class.inc.php index 0572a26..5946036 100644 --- a/external/podio-php/org/org.class.inc.php +++ b/external/podio-php/org/org.class.inc.php @@ -11,12 +11,12 @@ class PodioOrgAPI { public function __construct() { $this->podio = PodioBaseAPI::instance(); } - + /** * Creates a new organization * * @param $name The name of the new organization - * @param $logo The file id of the logo of the organization, + * @param $logo The file id of the logo of the organization, * leave blank for no logo * * @return Array with the new organization id and URL @@ -26,9 +26,9 @@ public function create($name, $logo = NULL) { return json_decode($response->getBody(), TRUE); } } - + /** - * Updates an organization with new name and logo. Note that the URL of the + * Updates an organization with new name and logo. Note that the URL of the * organization will not change even though the name changes. * * @param $org_id The id of the organization to update @@ -44,9 +44,9 @@ public function update($org_id, $name, $logo = NULL) { return json_decode($response->getBody(), TRUE); } } - + /** - * Deletes the organization with the given id. This will also delete all + * Deletes the organization with the given id. This will also delete all * spaces under the organization * * @param $org_id The organization id to delete @@ -59,7 +59,7 @@ public function delete($org_id) { return FALSE; } } - + /** * Gets the organization with the given id. * @@ -74,7 +74,7 @@ public function get($org_id) { } /** - * Returns the organization with the given full URL. The URL does not have + * Returns the organization with the given full URL. The URL does not have * to be truncated to the root, it can be to any resource on the URL. * * @param $url The URL to search for @@ -86,7 +86,7 @@ public function getByUrl($url) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns all the spaces for the organization. * @@ -99,7 +99,7 @@ public function getOrgSpaces($org_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns a list of all the organizations and spaces the user is member of. * @@ -110,10 +110,10 @@ public function getOrgs() { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the organizations and spaces that the logged in user shares with - * the specified user. The organizations and spaces will be returned sorted + * Returns the organizations and spaces that the logged in user shares with + * the specified user. The organizations and spaces will be returned sorted * by name. * * @param $user_id The user to compare current user to @@ -125,9 +125,9 @@ public function getShared($user_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns interesting statistics for this organization. Only org creator + * Returns interesting statistics for this organization. Only org creator * is allowed to see this. * * @param $org_id The id of the organization to get statistics for @@ -139,6 +139,6 @@ public function getStatistics($org_id) { return json_decode($response->getBody(), TRUE); } } - + } diff --git a/external/podio-php/rating/rating.class.inc.php b/external/podio-php/rating/rating.class.inc.php index b1666d2..a0580d0 100644 --- a/external/podio-php/rating/rating.class.inc.php +++ b/external/podio-php/rating/rating.class.inc.php @@ -1,18 +1,18 @@ getBody(), TRUE); } } - + /** - * Returns all the ratings for the given object. It will only return the + * Returns all the ratings for the given object. It will only return the * ratings that are enabled for the object. * * @param $ref_type The type of reference. E.g. "item", "status" or "share" @@ -55,7 +55,7 @@ public function getRatings($ref_type, $ref_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the rating value for the given rating type, object and user. * @@ -71,7 +71,7 @@ public function get($ref_type, $ref_id, $rating_type, $user_id = NULL) { if ($user_id) { $url .= '/'.$user_id; } - + if ($ref_id > 0 && $response = $this->podio->request($url)) { $value = json_decode($response->getBody(), TRUE); if (is_array($value)) { @@ -83,7 +83,7 @@ public function get($ref_type, $ref_id, $rating_type, $user_id = NULL) { } /** - * Removes a previous rating of the given type by the user of the + * Removes a previous rating of the given type by the user of the * specified object. * * @param $ref_type The type of reference. E.g. "item", "status" or "share" diff --git a/external/podio-php/search/search.class.inc.php b/external/podio-php/search/search.class.inc.php index 0344487..b160f58 100644 --- a/external/podio-php/search/search.class.inc.php +++ b/external/podio-php/search/search.class.inc.php @@ -1,7 +1,7 @@ podio = PodioBaseAPI::instance(); } - + /** * Returns the top most active members of the space. * @@ -26,7 +26,7 @@ public function getMembersTop($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the top spaces for the user * @@ -39,15 +39,15 @@ public function getTop($limit = 6) { return json_decode($response->getBody(), TRUE); } } - + /** * Add a new space to an organization. * * @param $org_id The id of the organization the space is in * @param $name The name of the space - * @param $post_on_new_app True if new apps should be announced with + * @param $post_on_new_app True if new apps should be announced with * a status update, false otherwise - * @param $post_on_new_member True if new members should be announced + * @param $post_on_new_member True if new members should be announced * with a status update, false otherwise * * @return Array with the new space id and URL @@ -59,20 +59,20 @@ public function create($org_id, $name, $post_on_new_app = TRUE, $post_on_new_mem 'post_on_new_app' => $post_on_new_app, 'post_on_new_member' => $post_on_new_member, ); - + if ($response = $this->podio->request('/space/', $data, HTTP_Request2::METHOD_POST)) { return json_decode($response->getBody(), TRUE); } } - + /** * Updates the space with the given id - * + * * @param $space_id The id of the space to act on * @param $name The name of the space - * @param $post_on_new_app True if new apps should be announced with a + * @param $post_on_new_app True if new apps should be announced with a * status update, false otherwise - * @param $post_on_new_member True if new members should be announced + * @param $post_on_new_member True if new members should be announced * with a status update, false otherwise */ public function update($space_id, $name, $post_on_new_app, $post_on_new_member) { @@ -85,9 +85,9 @@ public function update($space_id, $name, $post_on_new_app, $post_on_new_member) return json_decode($response->getBody(), TRUE); } } - + /** - * Deletes the space with the given id. This will also end all memberships + * Deletes the space with the given id. This will also end all memberships * of the space and cancel any space invites still outstanding. * * @param $space_id The id of the space to delete @@ -100,7 +100,7 @@ public function delete($space_id) { return FALSE; } } - + /** * Get the space with the given id * @@ -112,17 +112,17 @@ public function get($space_id) { if (!$space_id) { return FALSE; } - + if ($response = $this->podio->request('/space/'.$space_id)) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the space and organization with the given full URL. * * @param $url The URL of the space to retrieve - * @param $info Set to "1" to return the informationals on the + * @param $info Set to "1" to return the informationals on the * space, "0" otherwise. Defaults to "0". * * @return Space object @@ -132,11 +132,11 @@ public function getByURL($url, $info = 0) { return json_decode($response->getBody(), TRUE); } } - + /** - * Ends the users membership on the space, can also be called for members + * Ends the users membership on the space, can also be called for members * in state invited. - * + * * @param $space_id The id of the space to end membership on * @param $user_id The id of the user to end membership for */ @@ -148,7 +148,7 @@ public function deleteMember($space_id, $user_id) { return FALSE; } } - + /** * Updates a space membership with another role * @@ -161,7 +161,7 @@ public function updateMember($space_id, $user_id, $role) { return json_decode($response->getBody(), TRUE); } } - + /** * Used to get the details of an active users membership of a space. * @@ -174,12 +174,12 @@ public function getMember($space_id, $user_id) { if (!$space_id) { return FALSE; } - + if ($response = $this->podio->request('/space/'.$space_id.'/member/'.$user_id)) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the active members of the given space. * @@ -192,7 +192,7 @@ public function getMembers($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns a list of the members that have been removed from the space. * @@ -205,9 +205,9 @@ public function getMembersEnded($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the members that was invited to the space, but has not yet + * Returns the members that was invited to the space, but has not yet * accepted or declined. * * @return Array of users @@ -217,9 +217,9 @@ public function getInvites($space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the status for a space invitation. Used to present the proper + * Returns the status for a space invitation. Used to present the proper * screen to the user when attempting to join a space. * * @param $invite_code The invitation code sent in the space invite mail @@ -231,7 +231,7 @@ public function getInviteByToken($invite_code) { return json_decode($response->getBody(), TRUE); } } - + /** * Invites a list of users (either through user_id or email) to the space. * @@ -239,9 +239,9 @@ public function getInviteByToken($invite_code) { * @param $role The role of the new users * @param $subject The subject to put in the invitation mail to the users * @param $message The personalized message to put in the invitation - * @param $resend True if the invitation should be resend every week, + * @param $resend True if the invitation should be resend every week, * false otherwise - * @param $notify True if the inviter should be notified when the user + * @param $notify True if the inviter should be notified when the user * accepts or declines the invitation * @param $users Array of user ids to invite * @param $mails Array of e-mails to invite @@ -261,7 +261,7 @@ public function invite($space_id, $role, $subject, $message, $resend, $notify, $ } return FALSE; } - + /** * Used to accept an invite to a space * @@ -273,7 +273,7 @@ public function inviteAccept($invite_code) { } return FALSE; } - + /** * Used to decline an invite to a space for the active user * @@ -285,7 +285,7 @@ public function inviteDecline($invite_code) { } return FALSE; } - + /** * Resends the space invite with a new subject and message. * @@ -304,7 +304,7 @@ public function inviteResend($space_id, $user_id, $subject, $message) { } return FALSE; } - + /** * Returns the statistics for the space with the number of members, statuses, * items and comments. @@ -318,6 +318,6 @@ public function getStatistics($space_id) { return json_decode($response->getBody(), TRUE); } } - + } diff --git a/external/podio-php/status/status.class.inc.php b/external/podio-php/status/status.class.inc.php index b0ab11a..2716eff 100644 --- a/external/podio-php/status/status.class.inc.php +++ b/external/podio-php/status/status.class.inc.php @@ -1,9 +1,9 @@ podio = PodioBaseAPI::instance(); } - + /** - * Retrieves a status message by its id. The id of the status message is + * Retrieves a status message by its id. The id of the status message is * usually gotten from the stream. * * @param $status_id The id of the status to retrieve @@ -29,7 +29,7 @@ public function get($status_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Retrieves the latest status message on a space from a user. * @@ -44,15 +44,15 @@ public function getLatest($user_id, $space_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Creates a new status message for a user on a specific space. A status - * update is simply a short text message that the user wishes to share with + * Creates a new status message for a user on a specific space. A status + * update is simply a short text message that the user wishes to share with * the rest of the space. * * @param $space_id Id of space to create message on * @param $value The actual status message - * @param $file_ids Temporary files that have been uploaded and should be + * @param $file_ids Temporary files that have been uploaded and should be * attached to this item * @param $alerts The users who should be alerted about this status message */ @@ -65,19 +65,19 @@ public function create($space_id, $value, $file_ids = array(), $alerts = array() if ($file_ids) { $data['file_ids'] = $file_ids; } - + if ($response = $this->podio->request('/status/', $data, HTTP_Request2::METHOD_POST)) { return json_decode($response->getBody(), TRUE); } } - + /** - * This will update an existing status message. This will normally only be + * This will update an existing status message. This will normally only be * used to correct spelling and grammatical mistakes. * * @param $status_id Id of status to update * @param $value The updated status message - * @param $file_ids Temporary files that have been uploaded and should + * @param $file_ids Temporary files that have been uploaded and should * be attached to this item */ public function update($status_id, $value, $file_ids = array()) { @@ -86,10 +86,10 @@ public function update($status_id, $value, $file_ids = array()) { return json_decode($response->getBody(), TRUE); } } - + /** - * This is used to delete a status message. This is normally only done if - * the user regrets his status update. After deletion the status message + * This is used to delete a status message. This is normally only done if + * the user regrets his status update. After deletion the status message * will no longer be viewable by anyone. * * @param $status_id Id of the status to delete diff --git a/external/podio-php/stream/stream.class.inc.php b/external/podio-php/stream/stream.class.inc.php index 3b84227..0124271 100644 --- a/external/podio-php/stream/stream.class.inc.php +++ b/external/podio-php/stream/stream.class.inc.php @@ -1,8 +1,8 @@ podio = PodioBaseAPI::instance(); } - + /** - * Returns the global stream. The types of objects in the stream can - * be either "item", "status" or "task". See API documentation + * Returns the global stream. The types of objects in the stream can + * be either "item", "status" or "task". See API documentation * for details. * * @param $limit The number of stream objects to get. Defaults to 20 * @param $offset How far should the objects be offset, defaults to 0 - * @param $latest The date and time that all events should be before, + * @param $latest The date and time that all events should be before, * defaults to no limit * * @return An array of stream objects @@ -36,14 +36,14 @@ public function getGlobal($limit = 20, $offset = 0, $latest = NULL) { } /** - * Returns an organisation stream. The types of objects in the stream can - * be either "item", "status" or "task". See API documentation + * Returns an organisation stream. The types of objects in the stream can + * be either "item", "status" or "task". See API documentation * for details. * * @param $org_id The id of the organisation to get a stream for * @param $limit The number of stream objects to get. Defaults to 20 * @param $offset How far should the objects be offset, defaults to 0 - * @param $latest The date and time that all events should be before, + * @param $latest The date and time that all events should be before, * defaults to no limit * * @return An array of stream objects @@ -59,14 +59,14 @@ public function getOrg($org_id, $limit = 20, $offset = 0, $latest = NULL) { } /** - * Returns a space stream. The types of objects in the stream can - * be either "item", "status" or "task". See API documentation + * Returns a space stream. The types of objects in the stream can + * be either "item", "status" or "task". See API documentation * for details. * * @param $space_id The id of the space to get a stream for * @param $limit The number of stream objects to get. Defaults to 20 * @param $offset How far should the objects be offset, defaults to 0 - * @param $latest The date and time that all events should be before, + * @param $latest The date and time that all events should be before, * defaults to no limit * * @return An array of stream objects @@ -82,19 +82,19 @@ public function getSpace($space_id, $limit = 20, $offset = 0, $latest = NULL) { } /** - * Get objects for a stream. This includes items and statuses with comments, + * Get objects for a stream. This includes items and statuses with comments, * ratings, files and edits. * * @param $type The type of stream to get. May be: * - global: Stream for all spaces and organizations * - org: Stream for a single organization * - space: Stream for a single space - * + * * Defaults to 'global' * @param $ref_id The space id or org id when getting stream for org or space * @param $limit The number of stream objects to get. Defaults to 20 * @param $offset How far should the objects be offset, defaults to 0 - * @param $latest The date and time that all events should be before, + * @param $latest The date and time that all events should be before, * defaults to no limit * * @return An array of stream objects @@ -116,8 +116,8 @@ public function get($type = 'global', $ref_id = NULL, $limit = 20, $offset = 0, } /** - * Returns an object (item or status) as a stream object. This is useful - * when a new status has been posted and should be rendered directly in the + * Returns an object (item or status) as a stream object. This is useful + * when a new status has been posted and should be rendered directly in the * stream without reloading the entire stream. * * @param $ref_type The type of object. "status" or "item" @@ -134,8 +134,8 @@ public function getObject($ref_type = 'status', $ref_id = NULL) { } /** - * Returns an object (item or status) as a stream object. This is useful - * when a new status has been posted and should be rendered directly in the + * Returns an object (item or status) as a stream object. This is useful + * when a new status has been posted and should be rendered directly in the * stream without reloading the entire stream. * * @param $ref_type The type of object. "status" or "item" @@ -150,7 +150,7 @@ public function getObjectV2($ref_type = 'status', $ref_id = NULL) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the apps and spaces the user has muted in the global stream. */ @@ -159,7 +159,7 @@ public function getMutes() { return json_decode($response->getBody(), TRUE); } } - + /** * Mutes the app from the users global stream * @@ -184,7 +184,7 @@ public function unmuteApp($app_id) { return FALSE; } } - + /** * Mutes the space from the users global stream. * diff --git a/external/podio-php/subscription/subscription.class.inc.php b/external/podio-php/subscription/subscription.class.inc.php index d999df2..edd5bda 100644 --- a/external/podio-php/subscription/subscription.class.inc.php +++ b/external/podio-php/subscription/subscription.class.inc.php @@ -1,7 +1,7 @@ getBody(), TRUE); } } - + /** * Unsubscribe from getting notifications on actions on the given object. * @@ -40,7 +40,7 @@ public function delete($ref_type, $ref_id) { return FALSE; } } - + /** * Stops the subscription with the given id * @@ -54,7 +54,7 @@ public function deleteByID($subscription_id) { return FALSE; } } - + /** * Returns the subscription with the given id * diff --git a/external/podio-php/tag/tag.class.inc.php b/external/podio-php/tag/tag.class.inc.php index 04af109..ab17ea5 100644 --- a/external/podio-php/tag/tag.class.inc.php +++ b/external/podio-php/tag/tag.class.inc.php @@ -1,10 +1,10 @@ getBody(), TRUE); } } - + /** * Updates the tags on the given object. * @@ -62,15 +62,15 @@ public function remove($text, $ref_type, $ref_id) { $url = '/tag/'.$ref_type.'/'.$ref_id.'/'; $data = array('text' => $text); - + if ($response = $this->podio->request($url, $data, HTTP_Request2::METHOD_DELETE)) { return json_decode($response->getBody(), TRUE); } } /** - * Returns the tags on the given app. This includes only items. The tags - * are first limited ordered by their frequency of use, and then + * Returns the tags on the given app. This includes only items. The tags + * are first limited ordered by their frequency of use, and then * returned sorted alphabetically. * * @param $app_id The id of the app to get tags for. @@ -91,7 +91,7 @@ public function getByApp($app_id, $limit = NULL, $text = '') { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the top tags on the app. * @@ -115,8 +115,8 @@ public function getTopByApp($app_id, $limit = NULL, $text = '') { } /** - * Returns the tags on the given space. This includes both items and - * statuses. The tags are ordered firstly by the number of uses, + * Returns the tags on the given space. This includes both items and + * statuses. The tags are ordered firstly by the number of uses, * secondly by the tag text. * * @param $space_id The id of the space to get tags for @@ -127,11 +127,11 @@ public function getBySpace($space_id) { if ($response = $this->podio->request('/tag/space/'.$space_id . '/')) { return json_decode($response->getBody(), TRUE); } - } + } /** - * Returns the objects that are tagged with the given text on the space. - * The objects are returned sorted descending by the time the tag + * Returns the objects that are tagged with the given text on the space. + * The objects are returned sorted descending by the time the tag * was added. * * @param $space_id The id of the space to get tags for diff --git a/external/podio-php/task/task.class.inc.php b/external/podio-php/task/task.class.inc.php index 12a3d8c..c3a0a82 100644 --- a/external/podio-php/task/task.class.inc.php +++ b/external/podio-php/task/task.class.inc.php @@ -18,7 +18,7 @@ public function __construct() { * @param $text The text of the task * @param $private True if the task should be private, false otherwise * @param $due_date The due date of the task, leave blank for no due date - * @param $responsible The user id of the person responsible, + * @param $responsible The user id of the person responsible, * leave blank for self * @param $ref_type "item" or "status" or "space" to create task on these * @param $ref_id The item id or status id or space id @@ -37,12 +37,12 @@ public function create($text, $private = FALSE, $due_date = '', $responsible = N if ($responsible) { $data['responsible'] = (int)$responsible; } - + if ($response = $this->podio->request($url, $data, HTTP_Request2::METHOD_POST)) { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the task with the given id. * @@ -55,10 +55,10 @@ public function get($task_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Gets a list of tasks with a reference to the given object. This will - * return both active and completed tasks. The reference will not be + * Gets a list of tasks with a reference to the given object. This will + * return both active and completed tasks. The reference will not be * set on the individual tasks. * * @param $ref_type "item" or "status" @@ -71,7 +71,7 @@ public function getByRef($ref_type, $ref_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Update the private flag on the given task. * @@ -95,7 +95,7 @@ public function updateText($task_id, $text) { return TRUE; } } - + /** * Updates the due date of the task to the given value * @@ -107,9 +107,9 @@ public function updateDue($task_id, $due) { return TRUE; } } - + /** - * Assigns the task to another user. This makes the user responsible for + * Assigns the task to another user. This makes the user responsible for * the task and its completion. * * @param $task_id The id of the task to act on @@ -120,10 +120,10 @@ public function updateAssign($task_id, $responsible) { return TRUE; } } - + /** - * Returns the active tasks of the user. This is the tasks where the user - * is responsible. The tasks will be sorted by due date and creation time, + * Returns the active tasks of the user. This is the tasks where the user + * is responsible. The tasks will be sorted by due date and creation time, * and grouped by their due date status. * * @return An array of task objects, collected by due date categories @@ -133,7 +133,7 @@ public function getActive() { return json_decode($response->getBody(), TRUE); } } - + /** * Returns the total task count for the active user. * @@ -172,9 +172,9 @@ public function getTotalV2($space_id = NULL) { } return $list; } - + /** - * Returns the tasks that are started and where the active user + * Returns the tasks that are started and where the active user * is the responsible. * * @return An array of task objects, collected by due date categories @@ -186,7 +186,7 @@ public function getStarted() { } /** - * Returns the tasks that is completed and where the active user + * Returns the tasks that is completed and where the active user * is responsible. * * @return An array of task objects, collected by due date categories @@ -218,10 +218,10 @@ public function getAssignedCompleted() { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns all the tasks that are related to the space. It includes tasks - * with a direct reference to the space, and tasks with an indirect + * Returns all the tasks that are related to the space. It includes tasks + * with a direct reference to the space, and tasks with an indirect * reference to the space (like items and status updates). * * @param $space_id The id of the space to get tasks for @@ -234,7 +234,7 @@ public function getBySpace($space_id, $sort_by = 'due_date') { return json_decode($response->getBody(), TRUE); } } - + /** * Mark the given task as completed. * @@ -252,7 +252,7 @@ public function complete($task_id) { public function incomplete($task_id) { $this->podio->request('/task/'.$task_id.'/incomplete', array(), HTTP_Request2::METHOD_POST); } - + /** * Indicate that work has started on the given task. * @@ -261,7 +261,7 @@ public function incomplete($task_id) { public function start($task_id) { $this->podio->request('/task/'.$task_id.'/start', array(), HTTP_Request2::METHOD_POST); } - + /** * Indicate that worked has stopped on the given task. * @@ -270,7 +270,7 @@ public function start($task_id) { public function stop($task_id) { $this->podio->request('/task/'.$task_id.'/stop', array(), HTTP_Request2::METHOD_POST); } - + /** * This is used to delete a task. * @@ -284,6 +284,6 @@ public function delete($task_id) { return FALSE; } } - + } diff --git a/external/podio-php/user/user.class.inc.php b/external/podio-php/user/user.class.inc.php index de2fa2d..baa6fe7 100644 --- a/external/podio-php/user/user.class.inc.php +++ b/external/podio-php/user/user.class.inc.php @@ -11,7 +11,7 @@ class PodioUserAPI { public function __construct() { $this->podio = PodioBaseAPI::instance(); } - + /** * Gets the active user * @@ -24,8 +24,8 @@ public function get() { } /** - * Updates the active user. The old and new password can be left out, - * in which case the password will not be changed. If the mail is + * Updates the active user. The old and new password can be left out, + * in which case the password will not be changed. If the mail is * changed, the old password has to be supplied as well. * * @param $mail The new email of the user @@ -35,11 +35,11 @@ public function get() { * @param $timezone The timezone of the user */ public function update($mail, $old_password, $new_password, $locale, $timezone) { - + $data = array( - 'mail' => $mail, + 'mail' => $mail, 'old_password' => $old_password, - 'new_password' => $new_password, + 'new_password' => $new_password, 'locale' => $locale, 'timezone' => $timezone, ); @@ -48,14 +48,14 @@ public function update($mail, $old_password, $new_password, $locale, $timezone) unset($data['new_password']); unset($data['mail']); } - + $response = $this->podio->request('/user/'.$user_id, $data, HTTP_Request2::METHOD_PUT); if ($response && $response->getStatus() == '204') { return TRUE; } return FALSE; } - + /** * Returns the profile of the active user */ @@ -66,7 +66,7 @@ public function getOwnProfile() { } /** - * Returns the current status for the user. This includes the user data, + * Returns the current status for the user. This includes the user data, * profile data and notification data. */ public function getStatus() { @@ -91,7 +91,7 @@ public function getProperty($name) { } /** - * Sets the value of the property for the active user with the given name. + * Sets the value of the property for the active user with the given name. * The property is specific to the auth client used. * * @param $name String. Name of property to set. @@ -102,7 +102,7 @@ public function setProperty($name, $value) { return json_decode($response->getBody(), TRUE); } } - + /** * Deletes the property for the active user with the given name. * The property is specific to the auth client used. @@ -117,9 +117,9 @@ public function deleteProperty($name) { return FALSE; } } - + /** - * Updates the fields of an existing profile. Fields not specified will + * Updates the fields of an existing profile. Fields not specified will * not be updated. To delete a field set the value of the field to null. * * @param $data Array of field name/value pairs @@ -129,7 +129,7 @@ public function updateProfile($data = array()) { return json_decode($response->getBody(), TRUE); } } - + /** * Updates the specific field on the user. * @@ -141,7 +141,7 @@ public function updateProfileField($field, $value) { return json_decode($response->getBody(), TRUE); } } - + /** * Add a new user to Podio. * @@ -165,9 +165,9 @@ public function create($name, $mail, $password, $locale, $timezone, $source_type return json_decode($response->getBody(), TRUE); } } - + /** - * Used to recover a password. This method will send a recovery code to the + * Used to recover a password. This method will send a recovery code to the * users mail address, which can then be used to reset the password. * * @param $mail The e-mail to recover password for @@ -180,9 +180,9 @@ public function recoverPassword($mail) { return FALSE; } } - + /** - * Resets a users password by supplying a recovery code gotten in a mail + * Resets a users password by supplying a recovery code gotten in a mail * from the recover password operation. * * @param $password The new password for this user @@ -195,7 +195,7 @@ public function resetPassword($password, $recovery_code) { return json_decode($response->getBody(), TRUE); } } - + /** * Activates the given user. This will make it possible to login as the user. * @@ -217,7 +217,7 @@ public function activate($activation_code, $mail, $password, $name, $locale = NU if ($timezone) { $data['timezone'] = $timezone; } - + if ($response = $this->podio->request('/user/activate_user', $data, HTTP_Request2::METHOD_POST)) { if ($response->getStatus() == '204') { return TRUE; @@ -228,10 +228,10 @@ public function activate($activation_code, $mail, $password, $name, $locale = NU } /** - * Invites the contact to try out Podio. + * Invites the contact to try out Podio. * Either profile_id or mail must given. * - * @param $profile_id The id of the profile to invite. + * @param $profile_id The id of the profile to invite. * The profile must have an mail address * @param $mail The mail address of the person to invite */ @@ -262,7 +262,7 @@ public function delete() { return FALSE; } } - + /** * Returns the current first time user experience status for the user. * This includes user's number of orgs, spaces, apps and users. @@ -286,6 +286,6 @@ public function get1UXStatusForSpace($space_id) { return json_decode($response->getBody(), TRUE); } } - + } diff --git a/external/podio-php/widget/widget.class.inc.php b/external/podio-php/widget/widget.class.inc.php index ce888fd..ccb9908 100644 --- a/external/podio-php/widget/widget.class.inc.php +++ b/external/podio-php/widget/widget.class.inc.php @@ -1,7 +1,7 @@ podio = PodioBaseAPI::instance(); } - + /** - * Create a new widget on the given reference. Supported references are + * Create a new widget on the given reference. Supported references are * organizations, spaces and apps. * * @param $ref_type What to attach the widget to. "app" or "space" @@ -38,7 +38,7 @@ public function create($ref_type, $ref_id, $type, $title, $config) { return json_decode($response->getBody(), TRUE); } } - + /** * Updates a widget with a new title and configuration. * @@ -55,7 +55,7 @@ public function update($widget_id, $title, $config) { return FALSE; } } - + /** * Returns the widget with the given id. * @@ -68,9 +68,9 @@ public function get($widget_id) { return json_decode($response->getBody(), TRUE); } } - + /** - * Returns the widgets on the given reference for display. This includes the + * Returns the widgets on the given reference for display. This includes the * current data to be shown in the widgets. * * @param $ref_type What context to get widgets for. "app" or "space" @@ -83,7 +83,7 @@ public function getForDisplay($ref_type, $ref_id) { return json_decode($response->getBody(), TRUE); } } - + /** * Deletes the given widget. * @@ -97,9 +97,9 @@ public function delete($widget_id) { return FALSE; } } - + /** - * Updates the order of the widgets on a reference. The ids of the widgets + * Updates the order of the widgets on a reference. The ids of the widgets * should be put in the new requested order. * * @param $ref_type What context to update order for. "app" or "space" diff --git a/lib/app.js b/lib/app.js index b2da9db..6af0582 100644 --- a/lib/app.js +++ b/lib/app.js @@ -1,6 +1,6 @@ // logging window.log = function(){ - log.history = log.history || []; + log.history = log.history || []; log.history.push(arguments); if(this.console){ console.log( Array.prototype.slice.call(arguments) ); @@ -30,7 +30,7 @@ var getFavoriteApps = function () { $("#favedApps ul").remove(); $("#favedApps").html(''); favoriteAppsValues = []; - + // reset document.keydown $(document).unbind('keydown'); $(document).keydown(function (e) { @@ -40,46 +40,46 @@ var getFavoriteApps = function () { return false; }; }); - + app.get("favoriteApps", function(r){ if (r != null && r.values.length > 0) { for (var i = r.values.length - 1; i >= 0; i--){ favoriteAppsValues.push(r.values[i]); }; }; - + var favoriteAppsData = { item: favoriteAppsValues, notEmpty: function() { if (this.item.length > 0) {return true;} return false; } }; - + if (favoriteAppsValues.length == 0) { $("#favedApps").html('You have no favorite apps so far. Please use the search ^ to open an app.'); }; - + // show favoriteApps var html = Mustache.to_html(favoriteAppsTemplate, favoriteAppsData); $("#favedApps").append(html); $("#favedApps a").each(function(index, element) { - + // add hotkey for each app. just 1 till n $(document).keydown(function (e) { - + //if(e.keyCode == index + 49 && focusNotInForm()) { // start at keyCode 49, which is 1 if(e.keyCode == index + 49 && e.altKey) { // start at keyCode 49, which is 1 loadAppForm($(element).attr("id")); } }); - + // add click handler $(this).click(function(event) { event.preventDefault(); loadAppForm($(this).attr("id")); }).attr("accessKey", index+1); }); - + }); } @@ -152,7 +152,7 @@ var favApp = function () { // getinfos from current shown app form var appForm = $("#item_new_form"); var appId = $("#appId", appForm).val(); - + // check if app is already faved if (favoriteAppsValues.length > 0) { for (var i = favoriteAppsValues.length - 1; i >= 0; i--){ @@ -161,7 +161,7 @@ var favApp = function () { }; }; } - + favoriteAppsValues.push({ appId: appId, appName: $("#appName", appForm).val(), @@ -169,7 +169,7 @@ var favApp = function () { spaceName: $("#spaceName", appForm).val(), spaceUrl: $("#spaceUrl", appForm).val() }); - + app.save({key:'favoriteApps', values: favoriteAppsValues}); getFavoriteApps(); registeActionUnFavApp(); @@ -179,7 +179,7 @@ var unFavApp = function () { // getting infos from current shown app form var appForm = $("#item_new_form"); var appId = $("#appId", appForm).val(); - + // check if app is already faved if (favoriteAppsValues.length > 0) { for (var i = favoriteAppsValues.length - 1; i >= 0; i--){ @@ -188,7 +188,7 @@ var unFavApp = function () { }; }; } - + app.save({key:'favoriteApps', values: favoriteAppsValues}); getFavoriteApps(); registerActionFavApp(); @@ -198,13 +198,13 @@ var unFavApp = function () { // validates a form by checking if any required fields are not filled out. triggeres the validation on each form field keyup and change // form can not be sent if not all required fields have a value, also changes state of "submit" element var validateForm = function (element) { - + if ($(element).val().length > 0) { $(element).removeClass("required"); } else { $(element).addClass("required"); } - + if ($("#item_new_form .required").length <= 0) { $("#item_new_form input[type=submit]").removeAttr('disabled'); } else { diff --git a/lib/jquery-ui-1.8.7.custom/css/custom-theme/jquery-ui-1.8.7.custom.css b/lib/jquery-ui-1.8.7.custom/css/custom-theme/jquery-ui-1.8.7.custom.css index 3c2d173..f29093c 100755 --- a/lib/jquery-ui-1.8.7.custom/css/custom-theme/jquery-ui-1.8.7.custom.css +++ b/lib/jquery-ui-1.8.7.custom/css/custom-theme/jquery-ui-1.8.7.custom.css @@ -301,7 +301,7 @@ * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ @@ -389,7 +389,7 @@ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } diff --git a/lib/jquery.mousewheel.min.js b/lib/jquery.mousewheel.min.js index 05ebb0a..deab329 100644 --- a/lib/jquery.mousewheel.min.js +++ b/lib/jquery.mousewheel.min.js @@ -5,7 +5,7 @@ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * * Version: 3.0.2 - * + * * Requires: 1.2.2+ */ (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); \ No newline at end of file diff --git a/lib/jquery.tokeninput.js b/lib/jquery.tokeninput.js index ba2488c..fa293e8 100644 --- a/lib/jquery.tokeninput.js +++ b/lib/jquery.tokeninput.js @@ -186,7 +186,7 @@ break; } }); - + // Keep a reference to the original input box var hidden_input = $(input) .hide() @@ -196,9 +196,9 @@ .blur(function() { input_box.blur(); }); - + var hidden_input = $(settings.formElementToHoldIds); - + // Keep a reference to the selected token and dropdown item var selected_token = null; var selected_dropdown_item = null; @@ -352,7 +352,7 @@ // Add a token to the token list based on user input function add_token(item) { var li_data = $.data(item.get(0), "tokeninput"); - + var this_token = insert_token(li_data.id, li_data.name); // Clear input box and make sure it keeps focus @@ -371,18 +371,18 @@ input_box.hide(); hide_dropdown(); } - + if (token_count > 0) { $(input).removeClass("required"); - + if ($("#item_new_form .required").length <= 0) { $("#item_new_form input[type=submit]").removeAttr('disabled'); } else { $("#item_new_form input[type=submit]").attr('disabled', 'disabled'); } - + }; - + } // Select a token in the token list @@ -457,7 +457,7 @@ .val("") .focus(); } - + if (token_count == 0) { $(input).addClass("required"); if ($("#item_new_form .required").length <= 0) { @@ -466,7 +466,7 @@ $("#item_new_form input[type=submit]").attr('disabled', 'disabled'); } }; - + } // Hide and clear the results dropdown diff --git a/lib/lawnchair/Lawnchair.js b/lib/lawnchair/Lawnchair.js index d59ef31..b3b074b 100644 --- a/lib/lawnchair/Lawnchair.js +++ b/lib/lawnchair/Lawnchair.js @@ -9,7 +9,7 @@ var Lawnchair = function(opts) { } Lawnchair.prototype = { - + init:function(opts) { var adaptors = { 'webkit':window.WebkitSQLiteAdaptor, @@ -23,32 +23,32 @@ Lawnchair.prototype = { 'couch':window.CouchAdaptor }; this.adaptor = opts.adaptor ? new adaptors[opts.adaptor](opts) : new DOMStorageAdaptor(opts); - + // Check for native JSON functions. if (!JSON || !JSON.stringify) throw "Native JSON functions unavailable - please include http://www.json.org/json2.js or run on a decent browser :P"; }, - + // Save an object to the store. If a key is present then update. Otherwise create a new record. save:function(obj, callback) {this.adaptor.save(obj, callback)}, - + // Invokes a callback on an object with the matching key. get:function(key, callback) {this.adaptor.get(key, callback)}, // Returns whether a key exists to a callback. exists:function(callback) {this.adaptor.exists(callback)}, - + // Returns all rows to a callback. all:function(callback) {this.adaptor.all(callback)}, - + // Removes a json object from the store. remove:function(keyOrObj, callback) {this.adaptor.remove(keyOrObj, callback)}, - + // Removes all documents from a store and returns self. nuke:function(callback) {this.adaptor.nuke(callback);return this}, - + // Returns a page of results based on offset provided by user and perPage option paged:function(page, callback) {this.adaptor.paged(page, callback)}, - + /** * Iterator that accepts two paramters (methods or eval strings): * @@ -59,7 +59,7 @@ Lawnchair.prototype = { find:function(condition, callback) { var is = (typeof condition == 'string') ? function(r){return eval(condition)} : condition , cb = this.adaptor.terseToVerboseCallback(callback); - + this.each(function(record, index) { if (is(record)) cb(record, index); // thats hot }); diff --git a/lib/lawnchair/adaptors/AIRSqliteAdaptor.js b/lib/lawnchair/adaptors/AIRSqliteAdaptor.js index 3d7aaaa..5c5b23c 100644 --- a/lib/lawnchair/adaptors/AIRSqliteAdaptor.js +++ b/lib/lawnchair/adaptors/AIRSqliteAdaptor.js @@ -5,7 +5,7 @@ /* ADOBE SYSTEMS INCORPORATED Copyright 2007-2008 Adobe Systems Incorporated. All Rights Reserved. - + NOTICE: Adobe permits you to modify and distribute this file only in accordance with the terms of Adobe AIR SDK license agreement. You may have received this file from a source other than Adobe. Nonetheless, you may modify or @@ -52,7 +52,7 @@ if (window.runtime) - + /** * AIRSQLiteAdaptor * =================== @@ -74,18 +74,18 @@ var AIRSQLiteAdaptor = function(options) { AIRSQLiteAdaptor.prototype = { init:function(options) { - + var that = this; var merge = that.merge; var opts = (typeof arguments[0] == 'string') ? {table:options} : options; - + this.name = merge('Lawnchair', opts.name); this.table = merge('field', opts.table); - + this.conn = new air.SQLConnection(); var appstoredir = air.File.applicationStorageDirectory; this.dbFile = appstoredir.resolvePath(this.name + ".sqlite.db"); - + try { this.conn.open(this.dbFile); } catch(err) { @@ -95,9 +95,9 @@ AIRSQLiteAdaptor.prototype = { this._execSql('create table if not exists ' + this.table + ' (id NVARCHAR(32) UNIQUE PRIMARY KEY, value TEXT, timestamp REAL)'); }, - + /* - + */ save:function(obj, callback) { var that = this; @@ -110,9 +110,9 @@ AIRSQLiteAdaptor.prototype = { } else { id = obj.key; } - + delete(obj.key); - + var rs = that._execSql("INSERT INTO " + that.table + " (id, value, timestamp) VALUES (:id,:value,:timestamp)", { ':id':id, @@ -120,13 +120,13 @@ AIRSQLiteAdaptor.prototype = { ':timestamp':that.now() } ); - + if (callback != undefined) { obj.key = id; callback(obj); } }; - + var update = function(id, obj, callback) { var rs = that._execSql("UPDATE " + that.table + " SET value=:value, timestamp=:timestamp WHERE id=:id", { @@ -135,22 +135,22 @@ AIRSQLiteAdaptor.prototype = { ':timestamp':that.now() } ); - + if (callback != undefined) { obj.key = id; callback(obj); } }; - - + + if (obj.key == undefined) { - + insert(obj, callback); } else { - + this.get(obj.key, function(r) { var isUpdate = (r != null); - + if (isUpdate) { var id = obj.key; delete(obj.key); @@ -160,11 +160,11 @@ AIRSQLiteAdaptor.prototype = { } }); } - + }, - + /* - + */ get:function(key, callback) { var rs = this._execSql("SELECT * FROM " + this.table + " WHERE id = :id", @@ -172,7 +172,7 @@ AIRSQLiteAdaptor.prototype = { ':id':key } ); - + if (rs.data && rs.data.length> 0) { var o = this.deserialize(rs.data[0].value); o.key = key; @@ -183,17 +183,17 @@ AIRSQLiteAdaptor.prototype = { }, all:function(callback) { - + if (typeof callback === 'string') { throw new Error("Callback was a string; strings are not supported for callback shorthand under AIR"); } - + var cb = this.terseToVerboseCallback(callback); var rs = this._execSql("SELECT * FROM " + this.table); var r = []; var o; - - + + if (rs.data && rs.data.length > 0) { var k = 0; var numrows = rs.data.length; @@ -213,12 +213,12 @@ AIRSQLiteAdaptor.prototype = { }, - + /* - + */ remove:function(keyOrObj, callback) { - + var key = (typeof keyOrObj == 'string') ? keyOrObj : keyOrObj.key; var rs = this._execSql("DELETE FROM " + this.table + " WHERE id = :id", { @@ -227,20 +227,20 @@ AIRSQLiteAdaptor.prototype = { callback ); }, - + /* */ nuke:function(callback) { var rs = this._execSql("DELETE FROM " + this.table, {}, callback); }, - + /* this is a wrapper for the overly complex AIR SQL API method of executing SQL statements */ _execSql:function(sql, params, onSuccess, onError) { - + var stmt = new air.SQLStatement(); stmt.sqlConnection = this.conn; stmt.text = sql; @@ -249,10 +249,10 @@ AIRSQLiteAdaptor.prototype = { stmt.parameters[key] = params[key]; } } - + try { stmt.execute(); - + var rs = stmt.getResult(); if (onSuccess) { onSuccess(rs.data); diff --git a/lib/lawnchair/adaptors/AIRSqliteAsyncAdaptor.js b/lib/lawnchair/adaptors/AIRSqliteAsyncAdaptor.js index cd6c65a..de5bc51 100644 --- a/lib/lawnchair/adaptors/AIRSqliteAsyncAdaptor.js +++ b/lib/lawnchair/adaptors/AIRSqliteAsyncAdaptor.js @@ -5,7 +5,7 @@ /* ADOBE SYSTEMS INCORPORATED Copyright 2007-2008 Adobe Systems Incorporated. All Rights Reserved. - + NOTICE: Adobe permits you to modify and distribute this file only in accordance with the terms of Adobe AIR SDK license agreement. You may have received this file from a source other than Adobe. Nonetheless, you may modify or @@ -52,7 +52,7 @@ if (window.runtime) - + /** * AIRSQLiteAsyncAdaptor * =================== @@ -70,18 +70,18 @@ var AIRSQLiteAsyncAdaptor = function(options) { AIRSQLiteAsyncAdaptor.prototype = { init:function(options) { - + var that = this; var merge = that.merge; var opts = (typeof arguments[0] == 'string') ? {table:options} : options; - + this.name = merge('Lawnchair', opts.name); this.table = merge('field', opts.table); - + this.conn = new air.SQLConnection(); var appstoredir = air.File.applicationStorageDirectory; this.dbFile = appstoredir.resolvePath(this.name + ".sqlite.db"); - + try { this.conn.openAsync(this.dbFile); } catch(err) { @@ -91,9 +91,9 @@ AIRSQLiteAsyncAdaptor.prototype = { this._execSql('create table if not exists ' + this.table + ' (id NVARCHAR(32) UNIQUE PRIMARY KEY, value TEXT, timestamp REAL)'); }, - + /* - + */ save:function(obj, callback) { var that = this; @@ -106,9 +106,9 @@ AIRSQLiteAsyncAdaptor.prototype = { } else { id = obj.key; } - + delete(obj.key); - + that._execSql("INSERT INTO " + that.table + " (id, value, timestamp) VALUES (:id,:value,:timestamp)", { ':id':id, @@ -123,7 +123,7 @@ AIRSQLiteAsyncAdaptor.prototype = { } ); }; - + var update = function(id, obj, callback) { that._execSql("UPDATE " + that.table + " SET value=:value, timestamp=:timestamp WHERE id=:id", { @@ -135,20 +135,20 @@ AIRSQLiteAsyncAdaptor.prototype = { if (callback != undefined) { obj.key = id; callback(obj); - } + } } ); }; - - + + if (obj.key == undefined) { - + insert(obj, callback); } else { - + this.get(obj.key, function(r) { var isUpdate = (r != null); - + if (isUpdate) { var id = obj.key; delete(obj.key); @@ -158,11 +158,11 @@ AIRSQLiteAsyncAdaptor.prototype = { } }); } - + }, - + /* - + */ get:function(key, callback) { var that = this; @@ -184,7 +184,7 @@ AIRSQLiteAsyncAdaptor.prototype = { all:function(callback) { var that = this; - + if (typeof callback === 'string') { throw new Error("Callback was a string; strings are not supported for callback shorthand under AIR"); } @@ -212,12 +212,12 @@ AIRSQLiteAsyncAdaptor.prototype = { }); }, - + /* - + */ remove:function(keyOrObj) { - + var key = (typeof keyOrObj == 'string') ? keyOrObj : keyOrObj.key; this._execSql("DELETE FROM " + this.table + " WHERE id = :id", { @@ -225,20 +225,20 @@ AIRSQLiteAsyncAdaptor.prototype = { } ); }, - + /* */ nuke:function() { this._execSql("DELETE FROM " + this.table); }, - + /* this is a wrapper for the overly complex AIR SQL API method of executing SQL statements */ _execSql:function(sql, params, onSuccess, onError) { - + var stmt = new air.SQLStatement(); stmt.sqlConnection = this.conn; stmt.text = sql; @@ -247,15 +247,15 @@ AIRSQLiteAsyncAdaptor.prototype = { stmt.parameters[key] = params[key]; } } - - + + function resultHandler(event) { var rs = stmt.getResult(); if (onSuccess) { onSuccess(rs); } } - + function errorHandler(event) { air.trace('Error:' + event.error.message); air.trace('Error details:' + event.error.details); @@ -263,10 +263,10 @@ AIRSQLiteAsyncAdaptor.prototype = { onError(event.error); } } - - stmt.addEventListener(air.SQLEvent.RESULT, resultHandler); + + stmt.addEventListener(air.SQLEvent.RESULT, resultHandler); stmt.addEventListener(air.SQLErrorEvent.ERROR, errorHandler); - + try { stmt.execute(); } catch(err) { diff --git a/lib/lawnchair/adaptors/CouchAdaptor.js b/lib/lawnchair/adaptors/CouchAdaptor.js index 733c7ff..02d7de1 100644 --- a/lib/lawnchair/adaptors/CouchAdaptor.js +++ b/lib/lawnchair/adaptors/CouchAdaptor.js @@ -1,5 +1,5 @@ /** - * CouchAdaptor + * CouchAdaptor * ============ * Assumes http://localhost:5984/_utils/script/couch.js has been included. Not an unreasonable assumption. * @@ -18,10 +18,10 @@ CouchAdaptor.prototype = { if (options.name == undefined) throw("name required for the couch adaptor. try: new Lawnchair({name:'store', adaptor:'couch'})"); // FIXME - need to allow for running via CouchApp (rel path / no prefix) - CouchDB.urlPrefix = "http://127.0.0.1:5984"; + CouchDB.urlPrefix = "http://127.0.0.1:5984"; this.db = new CouchDB(options.name); // only create a db if it hasn't been - if (CouchDB.allDbs().indexOf(options.name) == -1) + if (CouchDB.allDbs().indexOf(options.name) == -1) this.db.createDb(); }, @@ -32,7 +32,7 @@ CouchAdaptor.prototype = { if (cb) cb(obj); }, - + get: function(keyOrObject, callback) { var key = typeof keyOrObject == 'object' ? keyOrObject.key : keyOrObject , cb = this.terseToVerboseCallback(callback); @@ -41,17 +41,17 @@ CouchAdaptor.prototype = { all: function(callback) { var map = function(doc) { - if (!doc.key) doc.key = doc._id; + if (!doc.key) doc.key = doc._id; emit(doc.key, doc); } , docs = this.db.query(map) , cb = this.terseToVerboseCallback(callback) , result = [] - // FIXME - seems inefficient + // FIXME - seems inefficient for (var i = 0, l = docs.rows.length; i < l; i++) { result.push(docs.rows[i].value); } - if (cb) + if (cb) cb(result); }, @@ -60,12 +60,12 @@ CouchAdaptor.prototype = { , me = this; if (typeof keyOrObj == 'object') { this.db.deleteDoc(keyOrObj); - if (cb) + if (cb) cb(); } else { - this.get(keyOrObj, function(r){ + this.get(keyOrObj, function(r){ me.db.deleteDoc(r); - if (cb) + if (cb) cb(); }); } @@ -76,7 +76,7 @@ CouchAdaptor.prototype = { this.db.createDb(); if (cb) cb(); - }, + }, // FIXME - not sure this is the right way to do this; would be useful for conditional code // that wants to check for capabilties on adaptor. (Eg, store.adaptor.db.replicate()) toString: function() { diff --git a/lib/lawnchair/adaptors/DOMStorageAdaptor.js b/lib/lawnchair/adaptors/DOMStorageAdaptor.js index c148698..efbdab4 100644 --- a/lib/lawnchair/adaptors/DOMStorageAdaptor.js +++ b/lib/lawnchair/adaptors/DOMStorageAdaptor.js @@ -20,7 +20,7 @@ DOMStorageAdaptor.prototype = { var self = this; this.storage = this.merge(window.localStorage, options.storage); this.table = this.merge('field', options.table); - + if (!window.Storage) { this.storage = (function () { // window.top.name ensures top level, and supports around 2Mb @@ -59,7 +59,7 @@ DOMStorageAdaptor.prototype = { get:function(key, callback) { var obj = this.deserialize(this.storage.getItem(this.table + '::' + key)) , cb = this.terseToVerboseCallback(callback); - + if (obj) { obj.key = key; if (callback) cb(obj); diff --git a/lib/lawnchair/adaptors/GearsSQLiteAdaptor.js b/lib/lawnchair/adaptors/GearsSQLiteAdaptor.js index 513fe5d..1a1710d 100644 --- a/lib/lawnchair/adaptors/GearsSQLiteAdaptor.js +++ b/lib/lawnchair/adaptors/GearsSQLiteAdaptor.js @@ -119,7 +119,7 @@ GearsSQLiteAdaptor.prototype = { var insert = function(obj, callback) { var id = (obj.key == undefined) ? that.uuid() : obj.key; delete(obj.key); - + var rs = that.db.execute( "INSERT INTO " + that.table + " (id, value, timestamp) VALUES (?,?,?)", [id, that.serialize(obj), that.now()] @@ -129,7 +129,7 @@ GearsSQLiteAdaptor.prototype = { callback(obj); } }; - + var update = function(id, obj, callback) { that.db.execute( "UPDATE " + that.table + " SET value=?, timestamp=? WHERE id=?", @@ -140,13 +140,13 @@ GearsSQLiteAdaptor.prototype = { callback(obj); } }; - + if (obj.key == undefined) { insert(obj, callback); } else { this.get(obj.key, function(r) { var isUpdate = (r != null); - + if (isUpdate) { var id = obj.key; delete(obj.key); @@ -156,11 +156,11 @@ GearsSQLiteAdaptor.prototype = { } }); } - + }, get:function(key, callback) { var rs = this.db.execute("SELECT * FROM " + this.table + " WHERE id = ?", [key]); - + if (rs.isValidRow()) { // FIXME need to test null return / empty recordset var o = this.deserialize(rs.field(1)); @@ -177,11 +177,11 @@ GearsSQLiteAdaptor.prototype = { var rs = this.db.execute("SELECT * FROM " + this.table); var r = []; var o; - + // FIXME need to add 0 len support //if (results.rows.length == 0 ) { // cb([]); - + while (rs.isValidRow()) { o = this.deserialize(rs.field(1)); o.key = rs.field(0); diff --git a/lib/lawnchair/adaptors/UserDataStorage.js b/lib/lawnchair/adaptors/UserDataStorage.js index 8fea174..cec127c 100644 --- a/lib/lawnchair/adaptors/UserDataStorage.js +++ b/lib/lawnchair/adaptors/UserDataStorage.js @@ -22,20 +22,20 @@ UserDataAdaptor.prototype = { this.storage.load('lawnchair'); }, get:function(key, callback){ - + var obj = this.deserialize(this.storage.getAttribute(key)); if (obj) { obj.key = key; - + } if (callback) callback(obj); }, save:function(obj, callback){ var id = obj.key || 'lc' + this.uuid(); - delete obj.key; + delete obj.key; this.storage.setAttribute(id, this.serialize(obj)); - this.storage.save('lawnchair'); + this.storage.save('lawnchair'); if (callback){ obj.key = id; callback(obj); @@ -59,20 +59,20 @@ UserDataAdaptor.prototype = { cb(yar); }, remove:function(keyOrObj,callback) { - var key = (typeof keyOrObj == 'string') ? keyOrObj : keyOrObj.key; + var key = (typeof keyOrObj == 'string') ? keyOrObj : keyOrObj.key; this.storage.removeAttribute(key); this.storage.save('lawnchair'); if(callback) callback(); - }, + }, nuke:function(callback) { - var that = this; + var that = this; this.all(function(r){ for (var i = 0, l = r.length; i < l; i++) { if (r[i].key) that.remove(r[i].key); } - if(callback) + if(callback) callback(); }); } diff --git a/lib/lawnchair/adaptors/WebkitSQLiteAdaptor.js b/lib/lawnchair/adaptors/WebkitSQLiteAdaptor.js index 403b434..9e6f320 100644 --- a/lib/lawnchair/adaptors/WebkitSQLiteAdaptor.js +++ b/lib/lawnchair/adaptors/WebkitSQLiteAdaptor.js @@ -34,9 +34,9 @@ WebkitSQLiteAdaptor.prototype = { if("onError" in opts) { this.onError = opts.onError; } - + if(typeof opts.callback !== 'function') opts.callback = function(){}; - + // error out on shit browsers if (!window.openDatabase) throw('Lawnchair, "This browser does not support sqlite storage."'); @@ -52,7 +52,7 @@ WebkitSQLiteAdaptor.prototype = { }, save:function(obj, callback) { var that = this; - + var update = function(id, obj, callback) { that.db.transaction(function(t) { t.executeSql( @@ -90,7 +90,7 @@ WebkitSQLiteAdaptor.prototype = { } else { this.get(obj.key, function(r) { var isUpdate = (r != null); - + if (isUpdate) { var id = obj.key; delete(obj.key); diff --git a/lib/mustache.js b/lib/mustache.js index ef2e8ad..788438f 100644 --- a/lib/mustache.js +++ b/lib/mustache.js @@ -66,7 +66,7 @@ var Mustache = function() { this.ctag); return template.replace(regex, function(match, pragma, options) { if(!that.pragmas_implemented[pragma]) { - throw({message: + throw({message: "This implementation of mustache doesn't understand the '" + pragma + "' pragma"}); } diff --git a/views/feedback.html b/views/feedback.html index 9269f8a..16435bd 100644 --- a/views/feedback.html +++ b/views/feedback.html @@ -13,7 +13,7 @@ - + - + @@ -16,12 +16,12 @@ - + - + - - + + - +