Remove whitespace [Gun.io WhitespaceBot]

This commit is contained in:
Gun.io Whitespace Robot 2011-10-29 09:45:46 -04:00
parent 80c1d9baf8
commit fd20014e82
77 changed files with 550 additions and 550 deletions

View file

@ -13,7 +13,7 @@
### How does OpenPhoto work?
OpenPhoto works similarly to Flickr, Smugmug and other photo sharing services with one major difference: you retain ownership and give OpenPhoto access to use them.
All photos, tags and comments are stored in your personal cloud accounts with companies like Amazon, Rackspace or Google.
All photos, tags and comments are stored in your personal cloud accounts with companies like Amazon, Rackspace or Google.
This means you can easily switch between OpenPhoto services, use more than one at a time or stop using them altogether while retaining all of your photos, tags and comments.
----------------------------------------
@ -22,15 +22,15 @@ This means you can easily switch between OpenPhoto services, use more than one a
While OpenPhoto functions like many existing services it's drastically different for several reasons.
1. **Ownership**
1. **Ownership**
Users can specify where their photos are stored. By default they are seamlessly stored in your [Amazon S3][s3] bucket.
1. **Built in backups**
1. **Built in backups**
Since you upload photos to your own [Amazon S3][s3] bucket it's like uploading and archiving your photos in one step.
1. **Portability**
1. **Portability**
Easily start off by signing up for a hosted OpenPhoto account and later switch to hosting the software yourself. There's no need to transfer your photos somewhere else since it's federated. It's like plug and play.
1. **Durability**
1. **Durability**
Your photos are not tied to any particular photo service. Because everything is open you can write your own web interface for your photos, choose between OpenPhoto hosting providers or install the OpenPhoto software on your own server.
1. **Community**
1. **Community**
New features will be entirely community driven. Features with the most votes will get top priority in getting implemented. If you want a feature that doesn't have many votes you can implement it yourself and issue a pull request.
----------------------------------------

View file

@ -16,13 +16,13 @@ Every API returns a JSON response adhering to the following format.
#### Message
The _message_ is a string which describes the action taken.
The _message_ is a string which describes the action taken.
It's purely for informational purposes and should never be used in your code or relied on.
#### Code
The _code_ is an integer representing the status of the API call.
Typically the _code_ value should be _200_ but anything between _200_ and _299_ indicates a successful response.
The _code_ is an integer representing the status of the API call.
Typically the _code_ value should be _200_ but anything between _200_ and _299_ indicates a successful response.
The photo upload API, for example, will return a _202_ response indicating that the resource has been created.
Below are some common codes:
@ -35,7 +35,7 @@ Below are some common codes:
#### Result
The _result_ can be any simple or complex value.
Consult the documentation for the endpoint you're using for information on what the _result_ will be.
The purpose of the _result_ is to allow you to continue processing the request.
The _result_ can be any simple or complex value.
Consult the documentation for the endpoint you're using for information on what the _result_ will be.
The purpose of the _result_ is to allow you to continue processing the request.
We'll try to return the information you'll most likely need and aim to keep you from having to make a subsequent call to get it.

View file

@ -72,7 +72,7 @@ The response is in a standard [response envelope][Envelope].
"result" : {
"previous" : {
"tags" : [
],
"id" : "bo",
"appId" : "openphoto-frontend",
@ -109,7 +109,7 @@ The response is in a standard [response envelope][Envelope].
},
"next" : {
"tags" : [
],
"id" : "63",
"appId" : "current.openphoto.me",

View file

@ -34,7 +34,7 @@ _Authentication: optional_
<a name="parameters"></a>
### Parameters
1. returnSizes (optional), The photo sizes you'd like in the response. Specify every size you plan on using. [Docs for this parameter][ReturnSizes]
1. returnSizes (optional), The photo sizes you'd like in the response. Specify every size you plan on using. [Docs for this parameter][ReturnSizes]
1. pageSize (optional), Number of photos to return per request.
1. page (optional), Page number when browsing through photos. Starts at 1.
1. tags (optional), _i.e. dog,cat_ - A comma delimited string of strings.

View file

@ -86,7 +86,7 @@ The response is in a standard [response envelope][Envelope].
},
{
"id": "Sunnyvale",
"count":23
"count":23
"latitude": 13.579,
"longitude": 24.68
},

View file

@ -18,7 +18,7 @@ Open Photo API / Photo Upload
<a name="purpose"></a>
### Purpose of the Photo update API
This API is used to update an existing photo's metadata for a user.
This API is used to update an existing photo's metadata for a user.
----------------------------------------

View file

@ -18,7 +18,7 @@ Open Photo API / Photo Upload
<a name="purpose"></a>
### Purpose of the Photo Upload API
This API is used to upload a new photo for a user.
This API is used to upload a new photo for a user.
----------------------------------------

View file

@ -2,7 +2,7 @@ Documentation
=======================
#### OpenPhoto, a photo service for the masses
This is a list of common questions that people have about OpenPhoto.
This is a list of common questions that people have about OpenPhoto.
If you have one which is not on this list send us a message via <a href="http://twitter.com/openphoto">Twitter</a> or <a href="mailto:hello@openphoto.me">email</a>.
### What exactly is OpenPhoto?
@ -11,33 +11,33 @@ The short answer is that OpenPhoto is a way to store and share your photos witho
The long answer is that OpenPhoto consists of two parts: a specification and an implementation.
The specification is a set of guidelines that define exactly how your photos are stored, how they are accessed and much more.
This helps make the entire system open and enables other developers to build functionality on top of your photos.
The specification is a set of guidelines that define exactly how your photos are stored, how they are accessed and much more.
This helps make the entire system open and enables other developers to build functionality on top of your photos.
The documentation makes up the majority of the specification.
The implementation is code which adheres to the specification and provides functionality.
The OpenPhoto.me website is an example where the funtionality provided is the ability to store and share photos.
Another example would be if a developer created an Instagram like application adhering to the specification.
The implementation is code which adheres to the specification and provides functionality.
The OpenPhoto.me website is an example where the funtionality provided is the ability to store and share photos.
Another example would be if a developer created an Instagram like application adhering to the specification.
That would be another implementation which provides the functionality of easily sharing photos from your phone with filters.
----------------------------------------
### What makes OpenPhoto different from Flickr, Smugmug, iCloud or any other service?
Normally you pay one company to store your photos and to provide services to share them.
Normally you pay one company to store your photos and to provide services to share them.
This means that you can't do much if they raise their prices, shut down their service or another site comes along.
These sites may offer APIs but they typically enable addon services and rarely competing services.
These sites may offer APIs but they typically enable addon services and rarely competing services.
Your photos are still stored on the company's servers who provide the base service.
With OpenPhoto you can switch between services, use more than one at a time or stop using the service and continue to have your photos stored.
With OpenPhoto you can switch between services, use more than one at a time or stop using the service and continue to have your photos stored.
----------------------------------------
### If OpenPhoto is open sourced then why isn't it free?
For clarity, OpenPhoto is both free and open sourced (FOSS).
Typically what you end up paying for is storage from someone like Amazon or Rackspace.
For clarity, OpenPhoto is both free and open sourced (FOSS).
Typically what you end up paying for is storage from someone like Amazon or Rackspace.
Amazon offers 5GB of storage for free which means if you don't need any additional space then using OpenPhoto is entirely free.

View file

@ -4,15 +4,15 @@ OpenPhoto / Glossary
The OpenPhoto stack consists of various components. Below is a glossary of all the terms you need to know so you can understand the overall system.
1. **Amazon S3**
1. **Amazon S3**
[Amazon S3][s3] stands for Simple Storage Service.
1. **Amazon SimpleDb**
1. **Amazon SimpleDb**
[Amazon SimpleDb][simpledb] is a non-relational database system.
1. **Data Source**
1. **Data Source**
The Data Source stores all textual data for a given user. Each user's Data Source may be different. The default Data Source is data.openphoto.me as a CNAME to [Amazon SimpleDb][simpledb].
1. **File System**
1. **File System**
The File System stores all high and low resolution photos for a given user. Each user's File System may be different. The default File System is file.openphoto.me as a CNAME to [Amazon S3][s3].
1. **Adapter**
1. **Adapter**
Adapters are middleware that allows the base system to communicate with various Data Sources and File Systems. Adapters exist for [Amazon S3][s3] and [Amazon SimpleDb][simpledb].
1. **Open Photo API**
[The Open Photo API][openphotoapi] which this software is built on and also allows others to build applications on top of.

View file

@ -17,7 +17,7 @@ This call returns the following response.
{
"code" : 200,
"message" : "Photo 63",
"result" : {
"result" : {
"appId" : "current.openphoto.me",
"creativeCommons" : "BY-NC",
"dateTaken" : "1313010850",
@ -57,10 +57,10 @@ The most important keys in the response are `path123x123` and `path200x200`. Eit
It's important to realize that the photo isn't generated and stored until this URL is called. This typically happens when the browser tries to display this photo. Once that has happened then the _123x123_ version exists both in the database and file system and calling the same API again returns a different URL for `path123x123`.
{
{
"code" : 200,
"message" : "Photo 63",
"result" : {
"result" : {
"appId" : "current.openphoto.me",
"creativeCommons" : "BY-NC",
"dateTaken" : "1313010850",
@ -99,7 +99,7 @@ The URL for `path123x123` now points to a static resource.
You can specify multiple sizes for the `returnSizes` delimited by commas.
curl "http://current.openphoto.me/photo/63.json?returnSizes=123x123,300x300xBW"
### Understanding options for returnSizes
The `returnSizes` parameter takes values in the form of _WxH[[xA]xB]_ which means it starts with a numeric _width_ and _height_. The most simple form is limited to specifying just a _width_ and _height_. This looks like `200x200` or `125x300`.

View file

@ -4,7 +4,7 @@
# Run with sudo for best results
#######################################
SECONDS=0
if [[ "$(/usr/bin/whoami)" != "root" ]]; then
if [[ "$(/usr/bin/whoami)" != "root" ]]; then
echo "This script must be run as root or using sudo.Script aborted."
exit 1
fi
@ -104,7 +104,7 @@ echo ""
# finding IP address and compensating for possible EC2 installation
EC2=`curl --silent --connect-timeout 1 http://169.254.169.254/latest/meta-data/public-hostname`
if [[ $EC2 != "" ]];
if [[ $EC2 != "" ]];
then
IP=`echo $EC2 | sed -rn 's/ec2-(.*?)\.compute.*/\1/p' | sed 's/-/./g'`
else

View file

@ -30,7 +30,7 @@ Before setting up your server you'll need to make sure you have your cloud accou
1. Click back to Instances and wait for new instance to finish starting.
1. Once started, click on the new instance in the web interface, copy the public DNS information.
### Launching your OpenPhoto site
Now you're ready to launch your OpenPhoto site. Point your browser to your new EC2 host and you'll be taken to a setup screen. You'll need your cloud account credentiato continue.
@ -47,10 +47,10 @@ Once you complete the 3 steps your site will be up and running and you'll be red
Open a terminal or SSH client, using your amazon ec2 ssh public key, ssh into the instance as the ubuntu user using the public DNS information for your instance.
ssh -i amazon-key.pem ubuntu@new-instance.amazonaws.com
Verify the apache user has write access to the /home/ubuntu/openphoto/src/configs directory.
cd /home/ubuntu/openphoto/src/
ls -ld ./configs
drwxr-xr-x 3 www-data www-data 4096 2011-08-20 02:37 configs

View file

@ -6,9 +6,9 @@ OpenPhoto
### What are schemas?
Schemas are the blueprint for various objects in the OpenPhoto platform.
The most logical example is the [Photo][Photo] object which represents a single photo in a user's photo collection.
Their photo library consists of a collection of [Photo][Photo] objects.
Schemas are the blueprint for various objects in the OpenPhoto platform.
The most logical example is the [Photo][Photo] object which represents a single photo in a user's photo collection.
Their photo library consists of a collection of [Photo][Photo] objects.
Other examples are a [User][User] object and [Action][Action] object.
----------------------------------------

View file

@ -6,7 +6,7 @@
Order deny,allow
Allow from all
Options FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@ -21,7 +21,7 @@
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</Directory>
# 404 Not Found for ini files
@ -36,7 +36,7 @@
ExpiresByType image/jpg "A604800"
ExpiresByType image/jpeg "A604800"
ExpiresByType image/png "A604800"
Header set Cache-Control "must-revalidate"
FileETag MTime Size
</VirtualHost>

View file

@ -20,7 +20,7 @@
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</Directory>
# 404 Not Found for ini files
@ -35,7 +35,7 @@
ExpiresByType image/jpg "A604800"
ExpiresByType image/jpeg "A604800"
ExpiresByType image/png "A604800"
Header set Cache-Control "must-revalidate"
FileETag MTime Size
</VirtualHost>

View file

@ -36,7 +36,7 @@
var scope = scope || window;
lib( element ).live(etype, lib.proxy(callback, scope) );
//key events need to use bind, for some reason only gets triggered
//when you input in textareas or inputs with jQuery
if (etype === "keydown" || etype === "keypress" || etype === "keyup") {
@ -58,8 +58,8 @@
lib( element ).die( type );
}
/**
* Makes an ajax post request
* @param {string} url to make request to
@ -70,9 +70,9 @@
* @method makeRequest
*/
OU.makeRequest = function(url, data, callback, format) {
lib.post(url, data, callback, format);
}

View file

@ -14,8 +14,8 @@
var PLUGIN_FILE_PREFIX = 'openphoto-lib-',
BROWSER_ID_SRC = 'https://browserid.org/include.js',
log = function(msg) { if(typeof(console) !== 'undefined') { console.log(msg); } };
/**
* Class that contains all utility functions for OpenPhoto
* We can use a Constructor function in this case since we will
@ -26,7 +26,7 @@
function Util() {
/**
* default configuration options
* default configuration options
* user can optionally specify an onComplete attribute in the css/js
* object which will execute when the assets are loaded.
* @type {object}
@ -50,7 +50,7 @@
* @property eventMap
*/
this.eventMap = {
'click': {
'action-box-click':'click:action-box',
'action-delete-click':'click:action-delete',
@ -71,12 +71,12 @@
'settings-click':'click:settings',
'webhook-delete-click':'click:webhook-delete'
},
'keydown': {
37: 'keydown:browse-previous',
39: 'keydown:browse-next'
}
};
/**
@ -85,20 +85,20 @@
* @property _customEvents
*/
this._customEvents = {};
/**
* Count of the number of scripts loaded
* @type {Number}
* @property _scriptLoadCount
*/
this._scriptLoadCount = 0;
/**
* Count of the number of css loaded
* @type {Number}
* @property _cssLoadCount
*/
this._cssLoadCount = 0;
this._cssLoadCount = 0;
/**
* initialization method
@ -124,7 +124,7 @@
// we specify what library type in the .ini file
// either jQuery or YUI - and then the user can load
// additional css/js assets by specifying the files in the
// additional css/js assets by specifying the files in the
// js config - as specified by the plugin file (that will be user generated).
//the library is a requirement, by default jQuery will be loaded
@ -143,7 +143,7 @@
* @method _init
*/
this._init = function() {
log('[Util] _init:')
var js = this.config.js.assets,
@ -151,7 +151,7 @@
i,
length;
//attach events
//attach events
this.attachEvent( 'body', 'click', this.onviewevent, this);
this.attachEvent( 'body', 'keydown', this.onkeydownevent, this);
@ -162,10 +162,10 @@
//load additional css in order specified
for(i=0, j=css.length; i<j; i++) {
this.loadCss( css[i], this._handleCssLoad, this );
this.loadCss( css[i], this._handleCssLoad, this );
}
};
};
/**
* handles events - delegates based on className
@ -182,19 +182,19 @@
length = classes.length,
map = this.eventMap[e.type],
cls;
while (length--) {
cls = classes[length];
if (map[cls]) {
//do not prevent the default action, let the callback
//function do it if it wants
this.fire( map[cls], e);
}
}
this.fire( map[cls], e);
}
}
};
/**
* handles keydown events
* @param {Event} e
@ -203,7 +203,7 @@
*/
this.onkeydownevent = function(e) {
log('[Util] keydownevent: ' + e.target);
var targ = e.target || e.srcElement,
classes = targ.className.split(" "),
length = classes.length,
@ -211,38 +211,38 @@
nodeName = targ.nodeName.toLowerCase(),
keyCode = e.keyCode,
cls;
if (nodeName === "textarea" || nodeName === "input") {
//i don't think there is a case where the user needs to know
//if the user is inputing text, but just in case, lets fire
//if the user is inputing text, but just in case, lets fire
//a custom event on user input
this.fire( 'keydown:user-input', e);
} else {
//the event map for key press can be two dimensional, it can be
//keycode, or className then keyCode, if keyCode, fire the custom event
if (map[keyCode]) {
this.fire( map[keyCode], e);
}
//both className and keycode
while (length--) {
cls = classes[length];
if (map[cls] && map[cls][keyCode]) {
//do not prevent the default action, let the callback
//function do it if it wants
this.fire( map[cls][keyCode], e);
}
this.fire( map[cls][keyCode], e);
}
}
}
};
/* -------------------------------------------------
* Utilities
* ------------------------------------------------- */
@ -264,9 +264,9 @@
//load the script and attach the event handlers onload
this.loadScript(url, this._init, this);
this.loadScript(BROWSER_ID_SRC);
};
/**
* Shallow merge of all objects passed into it in order of the objects passed in
* this is just needed to merge the config, but will probably be overwritten by
@ -295,7 +295,7 @@
return merged;
};
};
/**
* Utility function to dynamically load a script
@ -306,7 +306,7 @@
* @method loadScript
*/
this.loadScript = function(url, fn, scope) {
log('[Util] loadScript');
var head = document.getElementsByTagName('head')[0],
@ -334,7 +334,7 @@
}
head.appendChild(script);
};
@ -347,7 +347,7 @@
* @method loadScript
*/
this.loadCss = function(url, fn, scope) {
log('[Util] loadCss');
var head = document.getElementsByTagName('head')[0],
@ -376,9 +376,9 @@
}
head.appendChild(link);
};
/**
* The user can specify a callback to execute when all of the javascript assets
* have loaded. This helper method keeps track of the number of javascript assets
@ -387,15 +387,15 @@
* @method _handleScriptLoad
*/
this._handleScriptLoad = function() {
this._scriptLoadCount++;
if ( (this._scriptLoadCount === this.config.js.assets.length) && (typeof(this.config.js.onComplete) !== 'undefined')) {
this.config.js.onComplete();
}
}
}
/**
* The user can specify a callback to execute when all of the css assets
* have loaded. This helper method keeps track of the number of css assets
@ -404,13 +404,13 @@
* @method _handleCssLoad
*/
this._handleCssLoad = function() {
this._cssLoadCount++;
if ( (this._cssLoadCount === this.config.css.assets.length) && (typeof(this.config.css.onComplete) !== 'undefined')) {
this.config.css.onComplete();
}
}
}
/**
@ -419,7 +419,7 @@
* @method detectLibrary
*/
this.detectLibrary = function() {
//very simple for now, but we can extend it later
var lib = '';
@ -438,16 +438,16 @@
}
return lib;
};
};
/* -------------------------------------------------
* Custom Events
* ------------------------------------------------- */
/**
* Subscribe to a custom event - the callback will be executed when the custom event is fired
* Subscribe to a custom event - the callback will be executed when the custom event is fired
* @param {string} eventName - the name of the custom event to subscribe to
* @param {Function} callback - the callback function that will be executed when the event is fired
* @param {Object} scope - the scope of the callback function (what this will refer to)
@ -508,7 +508,7 @@
}
}
}
};
/**
@ -532,8 +532,8 @@
}
};
/**
* Object containing everything needed to upload photos
*
@ -562,7 +562,7 @@
returnSizes : "25x25xCR",
crumb : null
},
parent : this,
droppedFiles : {},
simultaneousUploads : 0,
@ -570,8 +570,8 @@
uploadQueue : [],
uploadQueueIndex : 0,
xhrs : [],
/**
* initialize upload area and functions
* @param {object} options - object defining options to override defaults
@ -588,7 +588,7 @@
this._fallbackUploader();
}
},
/**
* enable or disable duplicate photo name checking
* @param {bool} state should duplicates be allowed?
@ -602,10 +602,10 @@
this.options.allowDuplicates = false;
}
},
_uploadEventHandlers : function() {
/*
TODO prevent page from leaving with confirmation if user drops photo in wrong
TODO prevent page from leaving with confirmation if user drops photo in wrong
place or hits key to navigate before all uploads are done
*/
var that = this;
@ -614,7 +614,7 @@
that._addListener(that.dropZone, 'dragleave', that._handleDragLeave, that);
that._addListener(that.dropZone, 'drop', that._handleFileDrop, that);
},
/**
* wrapper for addEventListener to enable passing along the 'that' context
* @param target dom element to attach to
@ -630,30 +630,30 @@
callback(e,context);
}, false);
},
_handleDragEnter : function(e, that) {
e.stopPropagation();
e.preventDefault();
that.options.dragEnterCallback()
},
_handleDragLeave : function(e, that) {
e.stopPropagation();
e.preventDefault();
that.options.dragLeaveCallback();
},
/**
* when user's mouse moves over dropzone while draggin files
*
* if we don't prevent default, dropping the file
* if we don't prevent default, dropping the file
* wil cause the browser to redirect to the file location
**/
_handleDragOver : function(e, that) {
e.stopPropagation();
e.preventDefault();
},
_handleFileDrop : function(e, that) {
e.stopPropagation();
e.preventDefault();
@ -661,7 +661,7 @@
var files = e.dataTransfer.files;
that._checkForDuplicates(files);
},
_checkForDuplicates : function(files) {
var that = this;
if (!that.allowDuplicates) {
@ -678,7 +678,7 @@
}
that._validateIsImage(files);
},
_validateIsImage : function(files) {
var that = this;
/*
@ -687,7 +687,7 @@
// that.options.notImageCallback();
that._indexAndStack(files);
},
/**
* each file receives a reference number so that it can be correlated to
* its coresponding UI representation
@ -700,8 +700,8 @@
}
that.options.pushToUICallback(files);
},
// theme must call this to start uploading files
kickOffUploads : function() {
var that = this;
@ -721,14 +721,14 @@
}
}
},
_ajaxToServer : function(file) {
var that = this;
that.simultaneousUploads++;
var xhr = new XMLHttpRequest();
that.xhrs.push(xhr);
var formData = new FormData();
formData.append("crumb",that.options.crumb);
formData.append("returnSizes",that.options.returnSizes);
@ -736,8 +736,8 @@
formData.append("license", that.options.photoLicense(file.queueIndex));
formData.append("tags", that.options.photoTags(file.queueIndex));
formData.append("permission", that.options.permission(file.queueIndex));
xhr.open("POST", that.options.uploadPath, true);
xhr.open("POST", that.options.uploadPath, true);
xhr.onload = function(e) {
that.simultaneousUploads--;
// tell theme we finished
@ -751,10 +751,10 @@
that.options.uploadProgressCallback(file.queueIndex, progress);
}
};
xhr.send(formData);
},
_fallbackUploader : function() {
/*
TODO actually fallback to other uploader

View file

@ -7,12 +7,12 @@ var opTheme = (function() {
init: {
attach: function(PhotoSwipe) {
$('div.gallery-page').live('pageshow', function(e){
var
var
currentPage = $(e.target),
photoSwipeInstanceId = parseInt(Math.random()*10000),
photoSwipeInstance = PhotoSwipe.getInstance(photoSwipeInstanceId)
options = {};
if ($("ul.gallery a").length > 0 && (typeof photoSwipeInstance === "undefined" || photoSwipeInstance === null)) {
photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options, photoSwipeInstanceId);
}

View file

@ -10,22 +10,22 @@ var opTheme = (function() {
log("keyboard!!!!");
},
actionDelete: function(ev) {
ev.preventDefault();
var el = $(ev.target),
url = el.attr('href')+'.json'
id = el.attr('data-id');
OP.Util.makeRequest(url, el.parent().serializeArray(), function(response) {
if(response.code === 200)
$(".action-container-"+id).hide('medium', function(){ $(this).remove(); });
else
opTheme.message.error('Could not delete the photo.');
}, 'json');
return false;
},
commentJump: function(ev) {
ev.preventDefault();
@ -75,11 +75,11 @@ var opTheme = (function() {
});
},
photoDelete: function(ev) {
ev.preventDefault();
var el = $(ev.target),
url = el.parent().attr('action')+'.json';
OP.Util.makeRequest(url, el.parent().serializeArray(), function(response) {
if(response.code === 200) {
el.html('This photo has been deleted');
@ -315,7 +315,7 @@ var opTheme = (function() {
}
}
},
upload: {
init: function() {
var that = this; // that references upload
@ -338,7 +338,7 @@ var opTheme = (function() {
that.licenseChange();
}
},
options : {
simultaneousUploadLimit : 3,
frameId : "uploader-frame",
@ -347,7 +347,7 @@ var opTheme = (function() {
returnSizes : "50x50xCR",
allowDuplicates : false
},
licenseChange : function() {
$("#uploader-frame .license").bind("change", function() {
if ($(this).val() == "_custom_") {
@ -359,33 +359,33 @@ var opTheme = (function() {
}
});
},
/**
* !! REMINDER !!
* These functions are going to be called from within the
* opTheme.upload.options object so 'this' points back to
* These functions are going to be called from within the
* opTheme.upload.options object so 'this' points back to
* the options object
**/
dragEnter : function() {
this.$dropZone.removeClass("waiting active").addClass("hover");
},
dragLeave : function() {
this.$dropZone.removeClass("hover").addClass("active");
},
dragDrop : function() {
this.$dropZone.removeClass("hover").addClass("active");
},
duplicate : function() {
opTheme.message.error("duplicate image");
},
notImage : function() {
opTheme.message.error("not an image file");
},
pushToUI : function(files) {
// get current tags and license data to apply to each photo
var tags = $("#uploader-frame .tags").val();
@ -402,17 +402,17 @@ var opTheme = (function() {
this.$dropZone.append(html.join(""));
OP.Util.upload.kickOffUploads();
},
uploadStart : function(queueIndex) {
$("#file-"+queueIndex).removeClass("waiting").addClass("uploading");
},
uploadProgress : function(queueIndex, percent) {
$("#file-"+queueIndex+" .progress").animate({
"width":percent+"%"
}, 500);
},
uploadFinished : function(queueIndex, status, response) {
var thisClass = response.code == 202 ? 'finished' : 'error';
$("#file-"+queueIndex+" .progress").addClass(thisClass);
@ -420,15 +420,15 @@ var opTheme = (function() {
if(response.code == 202)
$("#file-"+queueIndex).append("<img class='thumb' src='"+response.result.path50x50xCR+"'/>");
},
permission : function(queueIndex) {
return $("#file-"+queueIndex).attr("permission");
},
photoLicense : function(queueIndex) {
return $("#file-"+queueIndex).attr("license");
},
photoTags : function(queueIndex) {
return $("#file-"+queueIndex).attr("tags");
}
@ -457,7 +457,7 @@ var opTheme = (function() {
$('form.validate').each(opTheme.formHandlers.init);
}
},
message: {
close: function() {
if(timeoutId != undefined) {

View file

@ -44,8 +44,8 @@ header>div{
height:48px;
border-bottom:solid 1px #fff;
}
header ul{
list-style-type:none;
header ul{
list-style-type:none;
display: inline-block;
position:relative;
left:200px;
@ -74,7 +74,7 @@ header ul li a{
}
div#searchbar{
display:none;
position:relative;
position:relative;
width:226px;
top:1px;
padding:10px;
@ -110,12 +110,12 @@ div#photos ul.grid>li {
width:200px;
height:225px;
padding: 25px 40px 25px 0;
}
}
div#photos ul.grid>li>a>img{
-moz-box-shadow: 2px 2px 2px #888;
-webkit-box-shadow: 2px 2px 2px #888;
}
div#photos ul.grid ul.options {
div#photos ul.grid ul.options {
margin:0;
padding:0;
list-style:none;

View file

@ -52,7 +52,7 @@ div#upload ul#upload-queue div.progress{
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-radius: 0px 0px 4px 4px;
border-radius: 0px 0px 4px 4px;
border-radius: 0px 0px 4px 4px;
}
div#upload ul#upload-queue div.progress > div{
@ -61,7 +61,7 @@ div#upload ul#upload-queue div.progress > div{
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-radius: 0px 0px 4px 4px;
border-radius: 0px 0px 4px 4px;
border-radius: 0px 0px 4px 4px;
background-image:url("../images/progress.gif");
}
div#upload ul#upload-queue div.progress > div.complete{
@ -103,9 +103,9 @@ div#upload ul#upload-queue div.progress > div.complete{
#drop-zone .photo { width: 100%; position: relative; height: 32px; z-index: 5; padding: 17px 0 6px 0;}
#drop-zone .photo .name { margin-left: 60px; }
#drop-zone .photo .size { float: right; margin-right: 5px; }
#drop-zone .photo > span.progress {
#drop-zone .photo > span.progress {
z-index: -1;
display: block;
display: block;
height: 100%;
background-color: #e5e88b;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e5e88b), color-stop(1, #f0f2ac));
@ -119,7 +119,7 @@ div#upload ul#upload-queue div.progress > div.complete{
top: 0px;
overflow: hidden;
}
#drop-zone .photo > span.progress.finished {
#drop-zone .photo > span.progress.finished {
background-color: rgb(43,194,83);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(43,194,83)), color-stop(1, rgb(84,240,84)) );
background-image: -webkit-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% );
@ -127,7 +127,7 @@ div#upload ul#upload-queue div.progress > div.complete{
background-image: -ms-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% );
background-image: -o-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% );
}
#drop-zone .photo > span.progress.error {
#drop-zone .photo > span.progress.error {
background-color: rgb(214,105,163);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(214,105,163)), color-stop(1, rgb(235,113,178)) );
background-image: -webkit-linear-gradient( center bottom, rgb(214,105,163) 37%, rgb(235,113,178) 69% );

View file

@ -1,20 +1,20 @@
<div data-role="page" data-add-back-btn="true" id="Gallery1" class="gallery-page" data-theme="c">
<div data-role="header" class="photoheader" data-theme="c"></div>
<div data-role="content">
<div data-role="content">
<form id="search-photo-form" action="/photos/list" method="get">
<div data-role="fieldcontain" class="center-wrapper">
<input type="search" name="tags" id="tags" placeholder="search your photos ..."/>
</div>
</form>
</form>
<ul data-role="listview" data-inset="true">
<li><a href="/photos/list"><img
src="<?php getTheme()->asset('image', 'header-navigation-photos.png'); ?>" alt="my photos"
class="ui-li-icon">Photos</a></li>
class="ui-li-icon">Photos</a></li>
<li><a href="/tags/list"><img
src="<?php getTheme()->asset('image', 'header-navigation-tags.png'); ?>" alt="tags"
class="ui-li-icon">Tags</a></li>
</ul>
</ul>
</div>
<div data-role="footer" data-theme="c">
<h4>The OpenPhoto Project &#169; <?php echo date('Y'); ?></h4>

View file

@ -2,7 +2,7 @@
<div data-role="header" class="photoheader" data-theme="c">
<a href="/" data-icon="home" class="ui-btn-right" rel="external">Home</a>
</div>
<div data-role="content">
<div data-role="content">
<div class="photo-details">
<div class="image-pagination">
<?php if(!empty($photo['previous'])) { ?>
@ -53,9 +53,9 @@
</ul>
</li>
</ul>
</div>
</div>
</div>
<div data-role="footer" data-theme="c">
<h4>The OpenPhoto Project &#169; <?php echo date('Y'); ?></h4>
</div>

View file

@ -2,7 +2,7 @@
<div data-role="header" class="photoheader" data-theme="c">
<a href="/" data-icon="home" class="ui-btn-right" rel="external">Home</a>
</div>
<div data-role="content">
<div data-role="content">
<?php if(!empty($photos)) { ?>
<ul class="gallery">
<?php foreach($photos as $photo) { ?>
@ -14,7 +14,7 @@
<h2>Sorry, no photos to see.</h2>
<?php } ?>
</div>
<div data-role="footer" data-theme="c">
<h4>The OpenPhoto Project &#169; <?php echo date('Y'); ?></h4>
</div>

View file

@ -2,7 +2,7 @@
<div data-role="header" class="photoheader" data-theme="c">
<a href="/" data-icon="home" class="ui-btn-right" rel="external">Home</a>
</div>
<div data-role="content">
<div data-role="content">
<?php if(empty($tags)) { ?>
Sorry, no photos have been tagged.
<?php } else { ?>

View file

@ -55,8 +55,8 @@
js: {
assets: [
'<?php getTheme()->asset('javascript', 'jquery.scrollTo-1.4.2-min.js'); ?>',
'<?php getTheme()->asset('javascript', 'jquery.fileupload.min.js'); ?>',
'<?php getTheme()->asset('javascript', 'jquery.cycle.min.js '); ?>',
'<?php getTheme()->asset('javascript', 'jquery.fileupload.min.js'); ?>',
'<?php getTheme()->asset('javascript', 'jquery.cycle.min.js '); ?>',
'<?php getTheme()->asset('javascript', 'openphoto-theme.js'); ?>'
],
onComplete: function(){ opTheme.init.attach(); }

View file

@ -23,7 +23,7 @@ class DatabaseMySql implements DatabaseInterface
public function __construct()
{
$mysql = getConfig()->get('mysql');
EpiDatabase::employ('mysql', $mysql->mySqlDb,
EpiDatabase::employ('mysql', $mysql->mySqlDb,
$mysql->mySqlHost, $mysql->mySqlUser, Utility::decrypt($mysql->mySqlPassword));
foreach($mysql as $key => $value) {
$this->{$key} = $value;
@ -189,7 +189,7 @@ class DatabaseMySql implements DatabaseInterface
* Retrieve group from the database specified by $id
*
* @param string $id id of the group to return
* @return mixed Array on success, FALSE on failure
* @return mixed Array on success, FALSE on failure
*/
public function getGroup($id = null)
{
@ -206,7 +206,7 @@ class DatabaseMySql implements DatabaseInterface
* Retrieve groups from the database optionally filter by member (email)
*
* @param string $email email address to filter by
* @return mixed Array on success, NULL on empty, FALSE on failure
* @return mixed Array on success, NULL on empty, FALSE on failure
*/
public function getGroups($email = null)
{
@ -900,9 +900,9 @@ class DatabaseMySql implements DatabaseInterface
$photo['appId'] = getConfig()->get('application')->appId;
$versions = $this->getPhotoVersions($photo['id']);
if($versions && !empty($versions))
if($versions && !empty($versions))
{
foreach($versions as $version)
foreach($versions as $version)
{
$photo[$version['key']] = $version['path'];
}
@ -1054,7 +1054,7 @@ class DatabaseMySql implements DatabaseInterface
{
$params['::bindings'] = $bindings;
}
return $params;
return $params;
}
/** Prepare credential to store in the database
*/
@ -1105,7 +1105,7 @@ class DatabaseMySql implements DatabaseInterface
/**
* Check the Db Version.
*
*
* This shouldn't fail unless you don't have database access
* But if the DB is empty (ie don't have the tables), it returns 0
* @return the numeric version. 0 means no DB
@ -1134,7 +1134,7 @@ class DatabaseMySql implements DatabaseInterface
{
if($version < 1)
return false;
switch($version) {
switch($version) {
case 1:
// after version 1 we added credential
//

View file

@ -11,7 +11,7 @@ class DatabaseSimpleDb implements DatabaseInterface
* Member variables holding the names to the SimpleDb domains needed and the database object itself.
* @access private
*/
private $db, $domainAction, $domainCredential, $domainPhoto,
private $db, $domainAction, $domainCredential, $domainPhoto,
$domainTag, $domainUser, $domainWebhook, $errors = array();
/**
@ -213,7 +213,7 @@ class DatabaseSimpleDb implements DatabaseInterface
* Retrieve group from the database specified by $id
*
* @param string $id id of the group to return
* @return mixed Array on success, FALSE on failure
* @return mixed Array on success, FALSE on failure
*/
public function getGroup($id = null)
{
@ -229,7 +229,7 @@ class DatabaseSimpleDb implements DatabaseInterface
* Retrieve groups from the database optionally filter by member (email)
*
* @param string $email email address to filter by
* @return mixed Array on success, NULL on empty, FALSE on failure
* @return mixed Array on success, NULL on empty, FALSE on failure
*/
public function getGroups($email = null)
{
@ -450,7 +450,7 @@ class DatabaseSimpleDb implements DatabaseInterface
$this->logErrors($res);
if(!$res->isOK())
return false;
if(isset($res->body->SelectResult))
{
@ -480,7 +480,7 @@ class DatabaseSimpleDb implements DatabaseInterface
if(count($domains) == 7)
return true;
$domainsToCreate = array($this->domainAction, $this->domainCredential, $this->domainGroup,
$domainsToCreate = array($this->domainAction, $this->domainCredential, $this->domainGroup,
$this->domainPhoto, $this->domainTag, $this->domainUser, $this->domainWebhook);
$queue = new CFBatchRequest();

View file

@ -6,7 +6,7 @@
* @author Hub Figuiere <hub@figuiere.net>
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class FileSystemDropboxBase
class FileSystemDropboxBase
{
private $parent;
public function __construct($parent)

View file

@ -9,7 +9,7 @@ class ApiController extends BaseController
/**
* A diagnostics endpoint used to verify backends are working.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function diagnostics()
{
@ -32,7 +32,7 @@ class ApiController extends BaseController
/**
* A diagnostics endpoint used to verify calls are working.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function hello()
{

View file

@ -1,7 +1,7 @@
<?php
/**
* Group controller for API endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class ApiGroupController extends BaseController
@ -10,7 +10,7 @@ class ApiGroupController extends BaseController
* Create a new group
* Returns the newly created group or false as the response data
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function create()
{
@ -31,7 +31,7 @@ class ApiGroupController extends BaseController
/**
* Delete a group
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function delete($id)
{
@ -48,7 +48,7 @@ class ApiGroupController extends BaseController
* Update an existing group
* Returns the newly created group or false as the response data
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function update($id)
{
@ -70,7 +70,7 @@ class ApiGroupController extends BaseController
/**
* Get the owner's groups
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function list_()
{
@ -87,7 +87,7 @@ class ApiGroupController extends BaseController
* Get the owner's group as specified by the groupId
*
* @param string $id The id of the group
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function view($id)
{

View file

@ -1,7 +1,7 @@
<?php
/**
* OAuth controller for API endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class ApiOAuthController extends BaseController

View file

@ -427,7 +427,7 @@ class ApiPhotoController extends BaseController
$filters['permission'] = $permission;
elseif($permission == -1)
$filters['groups'] = $groupIds;
return array('filters' => $filters, 'pageSize' => $pageSize, 'protocol' => $protocol, 'page' => $page);
}
}

View file

@ -10,7 +10,7 @@ class ApiTagController extends BaseController
/**
* Delete a tag in the tag database.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function delete($tag)
{
@ -25,7 +25,7 @@ class ApiTagController extends BaseController
/**
* Create a tag in the tag database.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function create()
{
@ -38,7 +38,7 @@ class ApiTagController extends BaseController
/**
* Update a tag in the tag database.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function update($tag)
{
@ -60,7 +60,7 @@ class ApiTagController extends BaseController
/**
* Return all tags.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function view()
{

View file

@ -1,7 +1,7 @@
<?php
/**
* User controller for API endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class ApiUserController extends BaseController
@ -9,7 +9,7 @@ class ApiUserController extends BaseController
/**
* Log a user in via BrowserID
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function login()
{
@ -23,7 +23,7 @@ class ApiUserController extends BaseController
/**
* Log a user in via mobilePassphrase
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function loginMobile()
{
@ -41,7 +41,7 @@ class ApiUserController extends BaseController
/**
* Log a user out.
*
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function logout()
{
@ -53,7 +53,7 @@ class ApiUserController extends BaseController
* Update a group
*
* @param string $id id of the group to update
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function postGroup($id = null)
{

View file

@ -21,7 +21,7 @@ class ApiWebhookController extends BaseController
return self::success("Webhook {$id} created", array_merge(array('id' => $id), $params));
else
return self::error("Error creating webhook {$id}", false);
}
}
/**
* Delete a webhook specified by the ID.
@ -32,7 +32,7 @@ class ApiWebhookController extends BaseController
public static function delete($id)
{
//getAuthentication()->requireAuthentication();
$status = Webhook::delete($id);
$status = Webhook::delete($id);
if($status)
return self::success('Webhook deleted successfully', true);
else

View file

@ -1,7 +1,7 @@
<?php
/**
* Base controller extended by all other controllers.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class BaseController
@ -20,7 +20,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function created($message, $result = null)
{
@ -32,7 +32,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function error($message, $result = null)
{
@ -44,7 +44,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function success($message, $result = null)
{
@ -56,7 +56,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function forbidden($message, $result = null)
{
@ -68,7 +68,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
public static function notFound($message, $result = null)
{
@ -80,7 +80,7 @@ class BaseController
*
* @param string $message A friendly message to describe the operation
* @param mixed $result The result with values needed by the caller to take action.
* @return string Standard JSON envelope
* @return string Standard JSON envelope
*/
private static function json($message, $code, $result = null)
{

View file

@ -1,7 +1,7 @@
<?php
/**
* Group controller for HTML endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class GroupController extends BaseController

View file

@ -60,7 +60,7 @@ class SetupController
$qs = '?edit';
$template = sprintf('%s/setup.php', getConfig()->get('paths')->templates);
$body = getTemplate()->get($template, array('filesystem' => $filesystem, 'database' => $database, 'themes' => $themes, 'theme' => $theme,
$body = getTemplate()->get($template, array('filesystem' => $filesystem, 'database' => $database, 'themes' => $themes, 'theme' => $theme,
'imageLibs' => $imageLibs, 'imageLibrary' => $imageLibrary, 'appId' => $appId, 'step' => $step, 'email' => $email, 'qs' => $qs, 'errors' => $errors));
getTheme()->display('template.php', array('body' => $body, 'page' => 'setup'));
}
@ -348,12 +348,12 @@ class SetupController
$template = sprintf('%s/setup.php', getConfig()->get('paths')->templates);
// copied to/from setup3Post()
$body = getTemplate()->get($template, array('step' => $step, 'themes' => $themes, 'usesAws' => $usesAws, 'usesMySql' => $usesMySql,
'database' => $database, 'filesystem' => $filesystem, 'usesLocalFs' => $usesLocalFs, 'usesS3' => $usesS3,
'usesSimpleDb' => $usesSimpleDb, 'awsKey' => $awsKey, 'awsSecret' => $awsSecret, 's3Bucket' => $s3Bucket,
'simpleDbDomain' => $simpleDbDomain, 'mySqlHost' => $mySqlHost, 'mySqlUser' => $mySqlUser, 'mySqlDb' => $mySqlDb,
'mySqlPassword' => $mySqlPassword, 'mySqlTablePrefix' => $mySqlTablePrefix, 'fsRoot' => $fsRoot, 'fsHost' => $fsHost,
'usesDropbox' => $usesDropbox, 'dropboxKey' => $dropboxKey, 'dropboxSecret' => $dropboxSecret, 'dropboxToken' => $dropboxToken,
$body = getTemplate()->get($template, array('step' => $step, 'themes' => $themes, 'usesAws' => $usesAws, 'usesMySql' => $usesMySql,
'database' => $database, 'filesystem' => $filesystem, 'usesLocalFs' => $usesLocalFs, 'usesS3' => $usesS3,
'usesSimpleDb' => $usesSimpleDb, 'awsKey' => $awsKey, 'awsSecret' => $awsSecret, 's3Bucket' => $s3Bucket,
'simpleDbDomain' => $simpleDbDomain, 'mySqlHost' => $mySqlHost, 'mySqlUser' => $mySqlUser, 'mySqlDb' => $mySqlDb,
'mySqlPassword' => $mySqlPassword, 'mySqlTablePrefix' => $mySqlTablePrefix, 'fsRoot' => $fsRoot, 'fsHost' => $fsHost,
'usesDropbox' => $usesDropbox, 'dropboxKey' => $dropboxKey, 'dropboxSecret' => $dropboxSecret, 'dropboxToken' => $dropboxToken,
'dropboxTokenSecret' => $dropboxTokenSecret, 'dropboxFolder' => $dropboxFolder, 'qs' => $qs, 'appId' => $appId, 'errors' => $errors));
getTheme()->display('template.php', array('body' => $body, 'page' => 'setup'));
@ -585,12 +585,12 @@ class SetupController
$template = sprintf('%s/setup.php', getConfig()->get('paths')->templates);
// copied to/from setup3()
$body = getTemplate()->get($template, array('step' => $step, 'themes' => $themes, 'usesAws' => $usesAws, 'usesMySql' => $usesMySql,
'database' => $database, 'filesystem' => $filesystem, 'usesLocalFs' => $usesLocalFs, 'usesS3' => $usesS3,
'usesSimpleDb' => $usesSimpleDb, 'awsKey' => $awsKey, 'awsSecret' => $awsSecret, 's3Bucket' => $s3Bucket,
'simpleDbDomain' => $simpleDbDomain, 'mySqlHost' => $mySqlHost, 'mySqlUser' => $mySqlUser, 'mySqlDb' => $mySqlDb,
'mySqlPassword' => $mySqlPassword, 'mySqlTablePrefix' => $mySqlTablePrefix, 'fsRoot' => $fsRoot, 'fsHost' => $fsHost,
'usesDropbox' => $usesDropbox, 'dropboxKey' => $dropboxKey, 'dropboxSecret' => $dropboxSecret, 'dropboxToken' => $dropboxToken,
$body = getTemplate()->get($template, array('step' => $step, 'themes' => $themes, 'usesAws' => $usesAws, 'usesMySql' => $usesMySql,
'database' => $database, 'filesystem' => $filesystem, 'usesLocalFs' => $usesLocalFs, 'usesS3' => $usesS3,
'usesSimpleDb' => $usesSimpleDb, 'awsKey' => $awsKey, 'awsSecret' => $awsSecret, 's3Bucket' => $s3Bucket,
'simpleDbDomain' => $simpleDbDomain, 'mySqlHost' => $mySqlHost, 'mySqlUser' => $mySqlUser, 'mySqlDb' => $mySqlDb,
'mySqlPassword' => $mySqlPassword, 'mySqlTablePrefix' => $mySqlTablePrefix, 'fsRoot' => $fsRoot, 'fsHost' => $fsHost,
'usesDropbox' => $usesDropbox, 'dropboxKey' => $dropboxKey, 'dropboxSecret' => $dropboxSecret, 'dropboxToken' => $dropboxToken,
'dropboxTokenSecret' => $dropboxTokenSecret, 'dropboxFolder' => $dropboxFolder, 'qs' => $qs, 'appId' => $appId, 'errors' => $errors));
getTheme()->display('template.php', array('body' => $body, 'page' => 'setup'));
}
@ -627,9 +627,9 @@ class SetupController
private static function getDefaultConfigParams()
{
return array('themes' => array(), 'awsKey' => '', 'awsSecret' => '', 's3Bucket' => '', 'simpleDbDomain' => '', 'mySqlHost' => '',
'mySqlUser' => '', 'mySqlPassword' => '', 'mySqlDb' => '', 'mySqlTablePrefix' => '',
'fsRoot' => '', 'fsHost' => '', 'dropboxFolder' => '', 'dropboxKey' => '', 'dropboxSecret' => '',
return array('themes' => array(), 'awsKey' => '', 'awsSecret' => '', 's3Bucket' => '', 'simpleDbDomain' => '', 'mySqlHost' => '',
'mySqlUser' => '', 'mySqlPassword' => '', 'mySqlDb' => '', 'mySqlTablePrefix' => '',
'fsRoot' => '', 'fsHost' => '', 'dropboxFolder' => '', 'dropboxKey' => '', 'dropboxSecret' => '',
'dropboxKey' => '', 'dropboxToken' => '', 'dropboxTokenSecret' => '', 'errors' => '');
}

View file

@ -1,7 +1,7 @@
<?php
/**
* Tag controller for HTML endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class TagController extends BaseController

View file

@ -1,7 +1,7 @@
<?php
/**
* User controller for HTML endpoints.
*
*
* @author Jaisen Mathai <jaisen@jmathai.com>
*/
class UserController extends BaseController

View file

@ -1,11 +1,11 @@
<?php
/**
* Dropbox API class
*
* @package Dropbox
* Dropbox API class
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
class Dropbox_API {
@ -19,45 +19,45 @@ class Dropbox_API {
* Dropbox root-path
*/
const ROOT_DROPBOX = 'dropbox';
/**
* API URl
*/
protected $api_url = 'api.dropbox.com/1/';
/**
* Content API URl
*/
protected $api_content_url = 'api-content.dropbox.com/0/';
/**
* OAuth object
*
* OAuth object
*
* @var Dropbox_OAuth
*/
protected $oauth;
/**
* Default root-path, this will most likely be 'sandbox' or 'dropbox'
*
* @var string
* Default root-path, this will most likely be 'sandbox' or 'dropbox'
*
* @var string
*/
protected $root;
/**
* Determines if connections should use SSL or not.
* Determines if connections should use SSL or not.
* Defaults to true in construtor
*
*
* @deprecated New Dropbox rest calls require SSL.
* @var boolean
*/
protected $useSSL;
/**
* Constructor
*
* Constructor
*
* @param Dropbox_OAuth Dropbox_Auth object
* @param string $root default root path (sandbox or dropbox)
* @param string $root default root path (sandbox or dropbox)
*/
public function __construct(Dropbox_OAuth $oauth, $root = self::ROOT_DROPBOX, $useSSL = true) {
@ -85,18 +85,18 @@ class Dropbox_API {
* * token
* * secret
*
* @param string $email
* @param string $password
* @return array
* @param string $email
* @param string $password
* @return array
*/
public function getToken($email, $password) {
$data = $this->oauth->fetch($this->api_url . 'token', array(
'email' => $email,
'email' => $email,
'password' => $password
),'POST');
$data = json_decode($data['body']);
$data = json_decode($data['body']);
return array(
'token' => $data->token,
'token_secret' => $data->secret,
@ -105,9 +105,9 @@ class Dropbox_API {
}
/**
* Returns information about the current dropbox account
*
* @return stdclass
* Returns information about the current dropbox account
*
* @return stdclass
*/
public function getAccountInfo() {
@ -119,11 +119,11 @@ class Dropbox_API {
/**
* Creates a new Dropbox account
*
* @param string $email
* @param string $first_name
* @param string $last_name
* @param string $password
* @return bool
* @param string $email
* @param string $first_name
* @param string $last_name
* @param string $password
* @return bool
*/
public function createAccount($email, $first_name, $last_name, $password) {
@ -134,17 +134,17 @@ class Dropbox_API {
'password' => $password,
), 'POST');
return $result['body']==='OK';
return $result['body']==='OK';
}
/**
* Returns a file's contents
*
* @param string $path path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return string
* Returns a file's contents
*
* @param string $path path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return string
*/
public function getFile($path = '', $root = null) {
@ -158,10 +158,10 @@ class Dropbox_API {
/**
* Uploads a new file
*
* @param string $path Target path (including filename)
* @param string $file Either a path to a file or a stream resource
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return bool
* @param string $path Target path (including filename)
* @param string $file Either a path to a file or a stream resource
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return bool
*/
public function putFile($path, $file, $root = null) {
@ -178,10 +178,10 @@ class Dropbox_API {
} elseif (!is_resource($file)) {
throw new Dropbox_Exception('File must be a file-resource or a string');
}
$result=$this->multipartFetch($this->api_content_url . 'files/' .
$result=$this->multipartFetch($this->api_content_url . 'files/' .
$root . '/' . trim($directory,'/'), $file, $filename);
if(!isset($result["httpStatus"]) || $result["httpStatus"] != 200)
if(!isset($result["httpStatus"]) || $result["httpStatus"] != 200)
throw new Dropbox_Exception("Uploading file to Dropbox failed");
return true;
@ -189,14 +189,14 @@ class Dropbox_API {
/**
* Copies a file or directory from one location to another
* Copies a file or directory from one location to another
*
* This method returns the file information of the newly created file.
*
* @param string $from source path
* @param string $to destination path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
* @param string $from source path
* @param string $to destination path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
*/
public function copy($from, $to, $root = null) {
@ -208,13 +208,13 @@ class Dropbox_API {
}
/**
* Creates a new folder
* Creates a new folder
*
* This method returns the information from the newly created directory
*
* @param string $path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
* @param string $path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
*/
public function createFolder($path, $root = null) {
@ -232,10 +232,10 @@ class Dropbox_API {
* Deletes a file or folder.
*
* This method will return the metadata information from the deleted file or folder, if successful.
*
* @param string $path Path to new folder
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return array
*
* @param string $path Path to new folder
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return array
*/
public function delete($path, $root = null) {
if (is_null($root)) $root = $this->root;
@ -245,14 +245,14 @@ class Dropbox_API {
}
/**
* Moves a file or directory to a new location
* Moves a file or directory to a new location
*
* This method returns the information from the newly created directory
*
* @param mixed $from Source path
* @param mixed $from Source path
* @param mixed $to destination path
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return stdclass
*/
public function move($from, $to, $root = null) {
@ -272,7 +272,7 @@ class Dropbox_API {
* @param string $path Path to directory or file
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @deprecated This method is no longer supported
* @return array
* @return array
*/
public function getLinks($path, $root = null) {
@ -280,22 +280,22 @@ class Dropbox_API {
/*
if (is_null($root)) $root = $this->root;
$response = $this->oauth->fetch($this->api_url . 'links/' . $root . '/' . ltrim($path,'/'));
return json_decode($response,true);
*/
*/
}
/**
* Returns file and directory information
*
* @param string $path Path to receive information from
*
* @param string $path Path to receive information from
* @param bool $list When set to true, this method returns information from all files in a directory. When set to false it will only return infromation from the specified directory.
* @param string $hash If a hash is supplied, this method simply returns true if nothing has changed since the last request. Good for caching.
* @param int $fileLimit Maximum number of file-information to receive
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return array|true
* @param int $fileLimit Maximum number of file-information to receive
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return array|true
*/
public function getMetaData($path, $list = true, $hash = null, $fileLimit = null, $root = null) {
@ -305,28 +305,28 @@ class Dropbox_API {
'list' => $list,
);
if (!is_null($hash)) $args['hash'] = $hash;
if (!is_null($fileLimit)) $args['file_limit'] = $fileLimit;
if (!is_null($hash)) $args['hash'] = $hash;
if (!is_null($fileLimit)) $args['file_limit'] = $fileLimit;
$path = str_replace(array('%2F','~'), array('/','%7E'), rawurlencode($path));
$response = $this->oauth->fetch($this->api_url . 'metadata/' . $root . '/' . ltrim($path,'/'), $args);
/* 304 is not modified */
if ($response['httpStatus']==304) {
return true;
return true;
} else {
return json_decode($response['body'],true);
}
}
}
/**
* Returns a thumbnail (as a string) for a file path.
*
* @param string $path Path to file
* @param string $size small, medium or large
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return string
* Returns a thumbnail (as a string) for a file path.
*
* @param string $path Path to file
* @param string $size small, medium or large
* @param string $root Use this to override the default root path (sandbox/dropbox)
* @return string
*/
public function getThumbnail($path, $size = 'small', $root = null) {
@ -338,11 +338,11 @@ class Dropbox_API {
}
/**
* This method is used to generate multipart POST requests for file upload
*
* @param string $uri
* @param array $arguments
* @return bool
* This method is used to generate multipart POST requests for file upload
*
* @param string $uri
* @param array $arguments
* @return bool
*/
protected function multipartFetch($uri, $file, $filename) {
@ -362,7 +362,7 @@ class Dropbox_API {
$body.="--" . $boundary . "--";
// Dropbox requires the filename to also be part of the regular arguments, so it becomes
// part of the signature.
// part of the signature.
$uri.='?file=' . $filename;
return $this->oauth->fetch($uri, $body, 'POST', $headers);

View file

@ -1,11 +1,11 @@
<?php
/**
* Dropbox base exception
*
* @package Dropbox
* Dropbox base exception
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/

View file

@ -2,10 +2,10 @@
/**
* Dropbox Forbidden exception
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/

View file

@ -2,16 +2,16 @@
/**
* Dropbox Not Found exception
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
/**
* This exception is thrown when a non-existant uri is accessed.
*
*
* Basically, this exception is used when we get back a 404.
*/
class Dropbox_Exception_NotFound extends Dropbox_Exception {

View file

@ -2,16 +2,16 @@
/**
* Dropbox Over Quota exception
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
/**
* This exception is thrown when the operation required more space than the available quota.
*
*
* Basically, this exception is used when we get back a 507.
*/
class Dropbox_Exception_OverQuota extends Dropbox_Exception {

View file

@ -2,10 +2,10 @@
/**
* Dropbox RequestToken exception
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/

View file

@ -2,10 +2,10 @@
/**
* Dropbox OAuth
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
@ -21,52 +21,52 @@ abstract class Dropbox_OAuth {
/**
* After a user has authorized access, dropbox can redirect the user back
* to this url.
*
*
* @var string
*/
public $authorizeCallbackUrl = null;
public $authorizeCallbackUrl = null;
/**
* Uri used to fetch request tokens
*
* Uri used to fetch request tokens
*
* @var string
*/
const URI_REQUEST_TOKEN = 'http://api.dropbox.com/0/oauth/request_token';
/**
* Uri used to redirect the user to for authorization.
*
*
* @var string
*/
const URI_AUTHORIZE = 'http://www.dropbox.com/0/oauth/authorize';
/**
* Uri used to
*
* Uri used to
*
* @var string
*/
const URI_ACCESS_TOKEN = 'http://api.dropbox.com/0/oauth/access_token';
/**
* An OAuth request token.
*
* @var string
* An OAuth request token.
*
* @var string
*/
protected $oauth_token = null;
/**
* OAuth token secret
*
* @var string
* OAuth token secret
*
* @var string
*/
protected $oauth_token_secret = null;
/**
* Constructor
*
* @param string $consumerKey
* @param string $consumerSecret
*
* @param string $consumerKey
* @param string $consumerSecret
*/
abstract public function __construct($consumerKey, $consumerSecret);
@ -75,9 +75,9 @@ abstract class Dropbox_OAuth {
*
* The tokens can also be passed as an array into the first argument.
* The array must have the elements token and token_secret.
*
* @param string|array $token
* @param string $token_secret
*
* @param string|array $token
* @param string $token_secret
* @return void
*/
public function setToken($token, $token_secret = null) {
@ -96,8 +96,8 @@ abstract class Dropbox_OAuth {
* Returns the oauth request tokens as an associative array.
*
* The array will contain the elements 'token' and 'token_secret'.
*
* @return array
*
* @return array
*/
public function getToken() {
@ -110,12 +110,12 @@ abstract class Dropbox_OAuth {
/**
* Returns the authorization url
*
* @param string $callBack Specify a callback url to automatically redirect the user back
* @return string
*
* @param string $callBack Specify a callback url to automatically redirect the user back
* @return string
*/
public function getAuthorizeUrl($callBack = null) {
// Building the redirect uri
$token = $this->getToken();
$uri = self::URI_AUTHORIZE . '?oauth_token=' . $token['token'];
@ -124,28 +124,28 @@ abstract class Dropbox_OAuth {
}
/**
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
*/
public abstract function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array());
public abstract function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array());
/**
* Requests the OAuth request token.
*
* @return array
*
* @return array
*/
abstract public function getRequestToken();
abstract public function getRequestToken();
/**
* Requests the OAuth access tokens.
*
* @return array
*/
abstract public function getAccessToken();
abstract public function getAccessToken();
}

View file

@ -2,17 +2,17 @@
/**
* Dropbox OAuth
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
/**
* This class is used to sign all requests to dropbox
*
*
* This classes use the PEAR HTTP_OAuth package. Make sure this is installed.
*/
class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
@ -26,18 +26,18 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
/**
* OAuth consumer key
*
* We need to keep this around for later.
*
* @var string
*
* We need to keep this around for later.
*
* @var string
*/
protected $consumerKey;
/**
* Constructor
*
* @param string $consumerKey
* @param string $consumerSecret
*
* @param string $consumerKey
* @param string $consumerSecret
*/
public function __construct($consumerKey, $consumerSecret) {
@ -47,7 +47,7 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
include 'HTTP/OAuth/Consumer.php';
}
if (!class_exists('HTTP_OAuth_Consumer'))
if (!class_exists('HTTP_OAuth_Consumer'))
throw new Dropbox_Exception('The HTTP_OAuth_Consumer class could not be found! Did you install the pear HTTP_OAUTH class?');
$this->OAuth = new HTTP_OAuth_Consumer($consumerKey, $consumerSecret);
@ -60,9 +60,9 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
*
* The tokens can also be passed as an array into the first argument.
* The array must have the elements token and token_secret.
*
* @param string|array $token
* @param string $token_secret
*
* @param string|array $token
* @param string $token_secret
* @return void
*/
public function setToken($token, $token_secret = null) {
@ -74,20 +74,20 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
}
/**
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
*/
public function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array())
{
$httpRequest = new HTTP_Request2(null,
HTTP_Request2::METHOD_GET,
$httpRequest = new HTTP_Request2(null,
HTTP_Request2::METHOD_GET,
array(
'ssl_verify_peer' => false,
'ssl_verify_peer' => false,
'ssl_verify_host' => false
)
);
@ -97,7 +97,7 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
$consumerRequest->setUrl($uri);
$consumerRequest->setMethod($method);
$consumerRequest->setSecrets($this->OAuth->getSecrets());
$parameters = array(
'oauth_consumer_key' => $this->consumerKey,
'oauth_signature_method' => 'HMAC-SHA1',
@ -132,9 +132,9 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
break;
case 403 :
throw new Dropbox_Exception_Forbidden('Forbidden. This could mean a bad OAuth request, or a file or folder already existing at the target location.');
case 404 :
case 404 :
throw new Dropbox_Exception_NotFound('Resource at uri: ' . $uri . ' could not be found');
case 507 :
case 507 :
throw new Dropbox_Exception_OverQuota('This dropbox is full');
}
@ -148,11 +148,11 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
/**
* Requests the OAuth request token.
*
*
* @return void
*/
public function getRequestToken() {
$this->OAuth->getRequestToken(self::URI_REQUEST_TOKEN);
$this->setToken($this->OAuth->getToken(), $this->OAuth->getTokenSecret());
return $this->getToken();
@ -164,8 +164,8 @@ class Dropbox_OAuth_PEAR extends Dropbox_OAuth {
*
* This method requires the 'unauthorized' request tokens
* and, if successful will set the authorized request tokens.
*
* @return void
*
* @return void
*/
public function getAccessToken() {

View file

@ -2,10 +2,10 @@
/**
* Dropbox OAuth
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/
@ -26,13 +26,13 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
/**
* Constructor
*
* @param string $consumerKey
* @param string $consumerSecret
*
* @param string $consumerKey
* @param string $consumerSecret
*/
public function __construct($consumerKey, $consumerSecret) {
if (!class_exists('OAuth'))
if (!class_exists('OAuth'))
throw new Dropbox_Exception('The OAuth class could not be found! Did you install and enable the oauth extension?');
$this->OAuth = new OAuth($consumerKey, $consumerSecret,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
@ -45,9 +45,9 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
*
* The tokens can also be passed as an array into the first argument.
* The array must have the elements token and token_secret.
*
* @param string|array $token
* @param string $token_secret
*
* @param string|array $token
* @param string $token_secret
* @return void
*/
public function setToken($token, $token_secret = null) {
@ -59,17 +59,17 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
/**
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
*/
public function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array()) {
try {
try {
$this->OAuth->fetch($uri, $arguments, $method, $httpHeaders);
$result = $this->OAuth->getLastResponse();
$lastResponseInfo = $this->OAuth->getLastResponseInfo();
@ -91,9 +91,9 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
break;
case 403 :
throw new Dropbox_Exception_Forbidden('Forbidden. This could mean a bad OAuth request, or a file or folder already existing at the target location.');
case 404 :
case 404 :
throw new Dropbox_Exception_NotFound('Resource at uri: ' . $uri . ' could not be found');
case 507 :
case 507 :
throw new Dropbox_Exception_OverQuota('This dropbox is full');
default:
// rethrowing
@ -107,10 +107,10 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
/**
* Requests the OAuth request token.
*
* @return void
* @return void
*/
public function getRequestToken() {
try {
$tokens = $this->OAuth->getRequestToken(self::URI_REQUEST_TOKEN);
@ -131,8 +131,8 @@ class Dropbox_OAuth_PHP extends Dropbox_OAuth {
*
* This method requires the 'unauthorized' request tokens
* and, if successful will set the authorized request tokens.
*
* @return void
*
* @return void
*/
public function getAccessToken() {

View file

@ -2,8 +2,8 @@
/**
* Dropbox OAuth
*
* @package Dropbox
*
* @package Dropbox
* @copyright Copyright (C) 2010 Stefan Motz
* @author Stefan Motz (http://www.multimediamotz.de/)
* @license MIT
@ -29,9 +29,9 @@ class Dropbox_OAuth_Wordpress extends Dropbox_OAuth {
/**
* Constructor
*
* @param string $consumerKey
* @param string $consumerSecret
*
* @param string $consumerKey
* @param string $consumerSecret
*/
public function __construct($consumerKey, $consumerSecret) {
if (!(defined('ABSPATH') && defined('WPINC')))
@ -45,13 +45,13 @@ class Dropbox_OAuth_Wordpress extends Dropbox_OAuth {
}
/**
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
* Fetches a secured oauth url and returns the response body.
*
* @param string $uri
* @param mixed $arguments
* @param string $method
* @param array $httpHeaders
* @return string
*/
public function fetch($uri, $arguments = array(), $method = 'GET', $httpHeaders = array()) {
@ -149,7 +149,7 @@ class Dropbox_OAuth_Wordpress extends Dropbox_OAuth {
/**
* Requests the OAuth request token.
*
* @return void
* @return void
*/
public function getRequestToken() {
$result = $this->fetch(self::URI_REQUEST_TOKEN, array(), 'POST');
@ -168,8 +168,8 @@ class Dropbox_OAuth_Wordpress extends Dropbox_OAuth {
*
* This method requires the 'unauthorized' request tokens
* and, if successful will set the authorized request tokens.
*
* @return void
*
* @return void
*/
public function getAccessToken() {
$result = $this->fetch(self::URI_ACCESS_TOKEN, array(), 'POST');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file registers a new autoload function using spl_autoload_register.
* This file registers a new autoload function using spl_autoload_register.
*
* @package Dropbox
* @package Dropbox
* @copyright Copyright (C) 2010 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/dropbox-php/wiki/License MIT
*/

View file

@ -45,13 +45,13 @@ class EpiApi
// restore sanity
foreach($tmps as $type => $value)
$GLOBALS[$type] = $value;
$GLOBALS[$type] = $value;
return $retval;
}
/**
* EpiApi::getRoute($route);
* EpiApi::getRoute($route);
* @name getRoute
* @author Jaisen Mathai <jaisen@jmathai.com>
* @param string $route

View file

@ -6,7 +6,7 @@ class EpiCache
private static $instances, $employ;
private $cached, $hash;
private function __construct(){}
/*
* @param type required
* @params optional
@ -46,7 +46,7 @@ class EpiCache
$params = func_get_args();
return $this->get(implode('.', $params));
}
protected function setByKey()
{
$params = func_get_args();

View file

@ -60,7 +60,7 @@ class EpiCache_Memcached extends EpiCache
if(class_exists('Memcached'))
{
$this->memcached = new Memcached;
if($this->memcached->addServer($this->host, $this->port))
return self::$connected = true;
else

View file

@ -64,7 +64,7 @@ class EpiConfig
self::$instance = new EpiConfig;
return self::$instance;
}
}
}
function getConfig()

View file

@ -51,7 +51,7 @@ class EpiCurl
$code = curl_multi_add_handle($this->mc, $ch);
$this->startTimer($key);
// (1)
if($code === CURLM_OK || $code === CURLM_CALL_MULTI_PERFORM)
{

View file

@ -6,7 +6,7 @@ class EpiDatabase
private $_type, $_name, $_host, $_user, $_pass;
public $dbh;
private function __construct(){}
public static function getInstance($type, $name, $host = 'localhost', $user = 'root', $pass = '')
{
$args = func_get_args();
@ -22,8 +22,8 @@ class EpiDatabase
self::$instances[$hash]->_pass = $pass;
return self::$instances[$hash];
}
/**
/**
* @return false in case of error
*/
public function execute($sql = false, $params = array())
@ -45,7 +45,7 @@ class EpiDatabase
return false;
}
}
public function insertId()
{
$this->init();
@ -55,7 +55,7 @@ class EpiDatabase
}
return false;
}
public function all($sql = false, $params = array())
{
$this->init();
@ -70,7 +70,7 @@ class EpiDatabase
return false;
}
}
public function one($sql = false, $params = array())
{
$this->init();

View file

@ -19,7 +19,7 @@ class EpiLogger
}
}
}
public function crit($message, $exception = null)
{
if(!isset($this->levels[self::Crit]))
@ -27,7 +27,7 @@ class EpiLogger
$this->log($message, self::Crit, $exception);
}
public function info($message, $exception = null)
{
if(!isset($this->levels[self::Info]))
@ -35,7 +35,7 @@ class EpiLogger
$this->log($message, self::Info, $exception);
}
public function warn($message, $exception = null)
{
if(!isset($this->levels[self::Warn]))

View file

@ -4,7 +4,7 @@
*
* This contains the EpiRoute class as wel as the EpiException abstract class
* @author Jaisen Mathai <jaisen@jmathai.com>
* @version 1.0
* @version 1.0
* @package EpiRoute
*/
@ -47,7 +47,7 @@ class EpiRoute
{
$this->addRoute($route, $callback, self::httpPost, $isApi);
}
/**
* NOT YET IMPLEMENTED
* request('/', 'function', array(EpiRoute::httpGet, EpiRoute::httpPost));
@ -85,9 +85,9 @@ class EpiRoute
$this->$method($route['path'], $route['function']);
}
}
/**
* EpiRoute::run($_GET['__route__'], $_['routes']);
* EpiRoute::run($_GET['__route__'], $_['routes']);
* @name run
* @author Jaisen Mathai <jaisen@jmathai.com>
* @param string $route
@ -116,7 +116,7 @@ class EpiRoute
/**
* EpiRoute::getRoute($route);
* EpiRoute::getRoute($route);
* @name getRoute
* @author Jaisen Mathai <jaisen@jmathai.com>
* @param string $route
@ -163,7 +163,7 @@ class EpiRoute
}
/**
* EpiRoute::redirect($url);
* EpiRoute::redirect($url);
* @name redirect
* @author Jaisen Mathai <jaisen@jmathai.com>
* @param string $url

View file

@ -27,7 +27,7 @@ class EpiSession_Apc implements EpiSessionInterface
{
if(empty($key))
return false;
$this->store[$key] = $value;
apc_store($this->key, $this->store);
return $value;

View file

@ -49,7 +49,7 @@ class EpiSession_Memcached implements EpiSessionInterface
{
if(!$this->connect() || empty($key))
return false;
$this->store[$key] = $value;
$this->memcached->set($this->key, $this->store);
return $value;

View file

@ -19,7 +19,7 @@ class EpiTemplate
{
extract($vars);
}
include $templateInclude;
}
else
@ -27,7 +27,7 @@ class EpiTemplate
EpiException::raise(new EpiException("Could not load template: {$templateInclude}", 404));
}
}
/**
* EpiRoute::get('/path/to/template.php', $array);
* @name get
@ -57,9 +57,9 @@ class EpiTemplate
EpiException::raise(new EpiException("Could not load template: {$templateInclude}", 404));
}
}
/**
* EpiRoute::json($variable);
* EpiRoute::json($variable);
* @name json
* @author Jaisen Mathai <jaisen@jmathai.com>
* @param mixed $data
@ -79,9 +79,9 @@ class EpiTemplate
EpiException::raise(new EpiException("json_encode failed for {$dataDump}", 404));
}
}
/**
* EpiRoute::jsonResponse($variable);
* EpiRoute::jsonResponse($variable);
* This method echo's JSON data in the header and to the screen and returns.
* @name jsonResponse
* @author Jaisen Mathai <jaisen@jmathai.com>

View file

@ -37,7 +37,7 @@ else
// if we're running setup and the config file exists, load it to prepopulate the form
if(file_exists($configFile))
getConfig()->load(sprintf('generated/%s.ini', getenv('HTTP_HOST')));
// setup and enable routes for setup
$baseDir = dirname(dirname(__FILE__));
$paths = new stdClass;

View file

@ -12,7 +12,7 @@ class Action
* Accepts a set of params that must include a type and targetType
*
* @param array $params Params describing the action to be added
* @return mixed Action ID on success, false on failure
* @return mixed Action ID on success, false on failure
*/
public static function add($params)
{

View file

@ -41,7 +41,7 @@ class Credential
$res = getDb()->putCredential($id, $params);
if($res)
return $id;
return false;
}
@ -67,7 +67,7 @@ class Credential
try
{
$this->provider->consumerHandler(array($this,'checkConsumer'));
$this->provider->consumerHandler(array($this,'checkConsumer'));
$this->provider->timestampNonceHandler(array($this,'checkTimestampAndNonce'));
$this->provider->tokenHandler(array($this,'checkToken'));
$this->provider->setParam('__route__', null);
@ -121,7 +121,7 @@ class Credential
if(!$cache)
$cache = array();
list($lastTimestamp, $nonces) = each($cache);
if($provider->timestamp > (time()+300) || $provider->timestamp < $lastTimestamp)
if($provider->timestamp > (time()+300) || $provider->timestamp < $lastTimestamp)
{
// timestamp can't be more then 30 seconds into the future
// or prior to the last timestamp

View file

@ -44,7 +44,7 @@ class Group
/**
* Get the next ID to be used for a action, group or photo.
* The ID is a base 32 string that represents an autoincrementing integer.
* @return string
* @return string
*/
public static function getGroups($email = null)
{

View file

@ -20,7 +20,7 @@ class ImageGraphicsMagick implements ImageInterface
* Constructor which initializes the Gmagick object.
*
* @param string $filename Full path to the file which will be manipulated
* @return void
* @return void
*/
public function __construct($filename)
{
@ -41,7 +41,7 @@ class ImageGraphicsMagick implements ImageInterface
* @param int $width Width of the resulting image
* @param int $height Height of the resulting image
* @param boolean $maintainAspectRatio When false it will crop to exact $width and $height else it will scale using "best fit"
* @return void
* @return void
*/
public function scale($width, $height, $maintainAspectRatio = true)
{
@ -54,7 +54,7 @@ class ImageGraphicsMagick implements ImageInterface
/**
* Greyscale an image
*
* @return void
* @return void
*/
public function greyscale()
{
@ -65,7 +65,7 @@ class ImageGraphicsMagick implements ImageInterface
* Save modifications to the image to the file system
*
* @param string $outputFile The file to write the modifications to.
* @return void
* @return void
*/
public function write($outputFile)
{

View file

@ -20,7 +20,7 @@ class ImageImageMagick implements ImageInterface
* Constructor which initializes the Imagick object.
*
* @param string $filename Full path to the file which will be manipulated
* @return void
* @return void
*/
public function __construct($filename)
{
@ -43,7 +43,7 @@ class ImageImageMagick implements ImageInterface
* @param int $width Width of the resulting image
* @param int $height Height of the resulting image
* @param boolean $maintainAspectRatio When false it will crop to exact $width and $height else it will scale using "best fit"
* @return void
* @return void
*/
public function scale($width, $height, $maintainAspectRatio = true)
{
@ -56,7 +56,7 @@ class ImageImageMagick implements ImageInterface
/**
* Greyscale an image
*
* @return void
* @return void
*/
public function greyscale()
{
@ -67,7 +67,7 @@ class ImageImageMagick implements ImageInterface
* Save modifications to the image to the file system
*
* @param string $outputFile The file to write the modifications to.
* @return void
* @return void
*/
public function write($outputFile)
{

View file

@ -13,7 +13,7 @@ class Photo
* This deletes the original photo and all versions.
*
* @param string $id ID of the photo
* @return boolean
* @return boolean
*/
public static function delete($id)
{
@ -33,7 +33,7 @@ class Photo
* @param int $width Width of the photo to generate
* @param int $height Height of the photo to generate
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return string
* @return string
*/
public static function generateCustomKey($width, $height, $options = null)
{
@ -47,7 +47,7 @@ class Photo
* @param int $width Width of the photo to generate
* @param int $height Height of the photo to generate
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return string
* @return string
*/
public static function generateFragment($width, $height, $options)
{
@ -63,7 +63,7 @@ class Photo
* The $options must start with a width and height (i.e. 800x600)
*
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return array
* @return array
*/
public static function generateFragmentReverse($options)
{
@ -82,7 +82,7 @@ class Photo
* @param string $param1 any parameter value
* ...
* @param string $paramN any parameter value
* @return string
* @return string
*/
public static function generateHash(/*$args1, $args2, ...*/)
{
@ -101,7 +101,7 @@ class Photo
* These paths will also be the initial versions of the photo that are stored in the file system and database.
*
* @param string $photoName File name of the photo
* @return array
* @return array
*/
public static function generatePaths($photoName)
{
@ -142,7 +142,7 @@ class Photo
* @param int $width The width of the requested photo.
* @param int $height The height of the requested photo.
* @param string $options Optional options to be applied on the photo
* @return string
* @return string
*/
// TODO make private and called via an API in the photo controller
public static function generateUrlInternal($id, $width, $height, $options = null)
@ -209,7 +209,7 @@ class Photo
* Reads exif data from a photo.
*
* @param $photo Path to the photo.
* @return array
* @return array
*/
public static function readExif($photo)
{
@ -226,8 +226,8 @@ class Photo
$dateTaken = @mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]);
}
$exif_array = array('dateTaken' => $dateTaken, 'width' => $size[0],
'height' => $size[1], 'cameraModel' => @$exif['Model'],
$exif_array = array('dateTaken' => $dateTaken, 'width' => $size[0],
'height' => $size[1], 'cameraModel' => @$exif['Model'],
'cameraMake' => @$exif['Make'],
'ISO' => @$exif['ISOSpeedRatings'],
'exposureTime' => @$exif['ExposureTime']);
@ -386,7 +386,7 @@ class Photo
getLogger()->info("Photo ({$id}) successfully stored to the database");
return $id;
}
else
else
{
getLogger()->warn("Photo ({$id}) could NOT be stored to the database");
return false;
@ -424,7 +424,7 @@ class Photo
{
return array(
'appId' => getConfig()->get('application')->appId,
'host' => getFs()->getHost(),
'host' => getFs()->getHost(),
'views' => 0,
'status' => 1,
'permission' => 0, // TODO
@ -439,7 +439,7 @@ class Photo
* @param $param2 One of the options
* ...
* @param $paramN One of the options
* @return boolean
* @return boolean
*/
private static function isValidateHash(/*$hash, $args1, $args2, ...*/)
{
@ -454,7 +454,7 @@ class Photo
return (substr(sha1(implode('.', $args)), 0, 5) == $hash);
}
private static function frac2Num($frac)
private static function frac2Num($frac)
{
$parts = explode('/', $frac);
@ -470,10 +470,10 @@ class Photo
return floatval($parts[0]) / floatval($parts[1]);
}
/*** GPS Utils
* from http://stackoverflow.com/questions/2526304/php-extract-gps-exif-data
/*** GPS Utils
* from http://stackoverflow.com/questions/2526304/php-extract-gps-exif-data
**/
private static function getGps($exifCoord, $hemi)
private static function getGps($exifCoord, $hemi)
{
$degrees = count($exifCoord) > 0 ? self::frac2Num($exifCoord[0]) : 0;
$minutes = count($exifCoord) > 1 ? self::frac2Num($exifCoord[1]) : 0;
@ -489,7 +489,7 @@ class Photo
* Reads IPTC data from a photo.
*
* @param $photo Path to the photo.
* @return array
* @return array
*/
private static function readIptc($photo)
{
@ -511,7 +511,7 @@ class Photo
$iptc_array['title'] = $iptc['2#105'][0];
else if(isset($iptc['2#005']))
$iptc_array['title'] = $iptc['2#005'][0];
if(isset($iptc['2#120']))
$iptc_array['description'] = $iptc['2#120'][0];
if(isset($iptc['2#025']))

View file

@ -47,12 +47,12 @@ class Url
else
return Utility::returnValue(sprintf('/photos/%s/list', $options), $write);
}
public static function photoUpload($write = true)
{
return Utility::returnValue('/photos/upload', $write);
}
public static function photosUpload($write = true)
{
return Utility::returnValue('/photos/upload', $write);

View file

@ -37,7 +37,7 @@ class User
/**
* Get the email address of the logged in user.
*
* @return string
* @return string
*/
public static function getEmailAddress()
{
@ -80,7 +80,7 @@ class User
{
$type = ucwords($type);
$key = "last{$type}Id";
$user = self::getUserRecord();
$user = self::getUserRecord();
if($user === false)
return false;

View file

@ -12,7 +12,7 @@ class Webhook
* Accepts a set of params that must include a type and targetType
*
* @param array $params Params describing the action to be added
* @return mixed Action ID on success, false on failure
* @return mixed Action ID on success, false on failure
*/
public static function add($params)
{

View file

@ -2,7 +2,7 @@
<form method="post">
<label>App Name</label>
<input type="text" name="name" placeholder="Enter a name">
<!--<label>Permission</label>
<ul>
<li><input type="checkbox" name="permissions[]" value="read" class="checkbox" checked="true"> Read</li>

View file

@ -65,7 +65,7 @@
<label>Members</label>
<input type="text" placeholder="Email addresses of members (separate with commas)" value="" name="members">
<button type="submit" class="group-update-click">Create a new group</button>
</form>
@ -81,7 +81,7 @@
<label>Members</label>
<input type="text" value="<?php Utility::safe(implode(',', $group['members'])); ?>" name="members">
<button type="submit" class="group-update-click">Update</button>
</form><!--(<a href="/group/<?php echo $group['id']; ?>/delete" class="group-delete-click">delete</a>)-->
</li>

View file

@ -332,7 +332,7 @@ class DatabaseSimpleDbTest extends PHPUnit_Framework_TestCase
->will($this->returnValue(new AWSBatchSuccessResponse));
$db = getDb();
$db->inject('db', $this->sdbStub);
$res = $db->postTags(array(array('id' => 'foo')));
$res = $db->postTags(array(array('id' => 'foo')));
$this->assertTrue($res, 'The SimpleDb adapter did not return TRUE for postTags');
}
@ -343,7 +343,7 @@ class DatabaseSimpleDbTest extends PHPUnit_Framework_TestCase
->will($this->returnValue(new AWSBatchFailureResponse));
$db = getDb();
$db->inject('db', $this->sdbStub);
$res = $db->postTags(array(array('id' => 'foo')));
$res = $db->postTags(array(array('id' => 'foo')));
$this->assertFalse($res, 'The SimpleDb adapter did not return FALSE for postTags');
}
@ -357,7 +357,7 @@ class DatabaseSimpleDbTest extends PHPUnit_Framework_TestCase
->will($this->returnValue(new AWSBatchSuccessResponse));
$db = getDb();
$db->inject('db', $this->sdbStub);
$res = $db->postTagsCounter(array('foo0' => 1, 'foo1' => 2));
$res = $db->postTagsCounter(array('foo0' => 1, 'foo1' => 2));
$this->assertTrue($res, 'The SimpleDb adapter did not return TRUE for postTags');
}
@ -368,7 +368,7 @@ class DatabaseSimpleDbTest extends PHPUnit_Framework_TestCase
->will($this->returnValue(new AWSBatchFailureResponse));
$db = getDb();
$db->inject('db', $this->sdbStub);
$res = $db->postTags(array('tag' => array('id' => 'foo')));
$res = $db->postTags(array('tag' => array('id' => 'foo')));
$this->assertFalse($res, 'The SimpleDb adapter did not return FALSE for postTags');
}

View file

@ -52,12 +52,12 @@ class AWSBatchSuccessResponse extends AWSSuccessResponse
public function create_domain()
{
return new AWSSuccessResponse;
return new AWSSuccessResponse;
}
public function create_object()
{
return new AWSSuccessResponse;
return new AWSSuccessResponse;
}
public function put_attributes()
@ -79,7 +79,7 @@ class AWSBatchSuccessResponse extends AWSSuccessResponse
$retval = array(new AWSPhotoMockSdb($this->count));
break;
default:
$retval = new AWSSuccessResponse;
$retval = new AWSSuccessResponse;
break;
}
return $retval;
@ -100,7 +100,7 @@ class AWSBatchFailureResponse extends AWSFailureResponse
public function send()
{
return new AWSFailureResponse;
return new AWSFailureResponse;
}
public function put_attributes()
@ -110,7 +110,7 @@ class AWSBatchFailureResponse extends AWSFailureResponse
public function create_object()
{
return new AWSFailureResponse;
return new AWSFailureResponse;
}
}