diff --git a/ajax/delBookmark.php b/ajax/delBookmark.php
index 26437ea0..91ff6b0e 100644
--- a/ajax/delBookmark.php
+++ b/ajax/delBookmark.php
@@ -29,7 +29,7 @@ OCP\JSON::checkAppEnabled('bookmarks');
OCP\JSON::callCheck();
$id = $_POST['id'];
-if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
+if (!OC_Bookmarks_Bookmarks::deleteUrl($id)) {
OC_JSON::error();
exit();
}
diff --git a/ajax/editBookmark.php b/ajax/editBookmark.php
index 617021e4..b03261c9 100644
--- a/ajax/editBookmark.php
+++ b/ajax/editBookmark.php
@@ -28,7 +28,7 @@ OCP\JSON::callCheck();
OCP\JSON::checkAppEnabled('bookmarks');
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
-if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) {
$_ut = "strftime('%s','now')";
} elseif($CONFIG_DBTYPE == 'pgsql') {
$_ut = 'date_part(\'epoch\',now())::integer';
diff --git a/appinfo/migrate.php b/appinfo/migrate.php
index f1446926..f8a037b3 100644
--- a/appinfo/migrate.php
+++ b/appinfo/migrate.php
@@ -2,7 +2,7 @@
class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
// Create the xml for the user supplied
- function export( ){
+ function export( ) {
$options = array(
'table'=>'bookmarks',
'matchcol'=>'user_id',
@@ -31,14 +31,14 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
}
// Import function for bookmarks
- function import( ){
- switch( $this->appinfo->version ){
+ function import( ) {
+ switch( $this->appinfo->version ) {
default:
// All versions of the app have had the same db structure, so all can use the same import function
$query = $this->content->prepare( "SELECT * FROM `bookmarks` WHERE `user_id` LIKE ?" );
$results = $query->execute( array( $this->olduid ) );
$idmap = array();
- while( $row = $results->fetchRow() ){
+ while( $row = $results->fetchRow() ) {
// Import each bookmark, saving its id into the map
$query = OCP\DB::prepare( "INSERT INTO `*PREFIX*bookmarks`(`url`, `title`, `user_id`, `public`, `added`, `lastmodified`) VALUES (?, ?, ?, ?, ?, ?)" );
$query->execute( array( $row['url'], $row['title'], $this->uid, $row['public'], $row['added'], $row['lastmodified'] ) );
@@ -46,10 +46,10 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
$idmap[$row['id']] = OCP\DB::insertid();
}
// Now tags
- foreach($idmap as $oldid => $newid){
+ foreach($idmap as $oldid => $newid) {
$query = $this->content->prepare( "SELECT * FROM `bookmarks_tags` WHERE `bookmark_id` LIKE ?" );
$results = $query->execute( array( $oldid ) );
- while( $row = $results->fetchRow() ){
+ while( $row = $results->fetchRow() ) {
// Import the tags for this bookmark, using the new bookmark id
$query = OCP\DB::prepare( "INSERT INTO `*PREFIX*bookmarks_tags`(`bookmark_id`, `tag`) VALUES (?, ?)" );
$query->execute( array( $newid, $row['tag'] ) );
diff --git a/bookmarksHelper.php b/bookmarksHelper.php
index 988042fc..0c302a33 100644
--- a/bookmarksHelper.php
+++ b/bookmarksHelper.php
@@ -56,7 +56,7 @@ function getURLMetadata($url) {
}
$metadata['url'] = $url;
- if (!function_exists('curl_init')){
+ if (!function_exists('curl_init')) {
return $metadata;
}
$ch = curl_init();
@@ -73,7 +73,7 @@ function getURLMetadata($url) {
function addBookmark($url, $title, $tags='') {
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
- if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) {
$_ut = "strftime('%s','now')";
} elseif($CONFIG_DBTYPE == 'pgsql') {
$_ut = 'date_part(\'epoch\',now())::integer';
diff --git a/lib/bookmarks.php b/lib/bookmarks.php
index e1e13388..094abe11 100644
--- a/lib/bookmarks.php
+++ b/lib/bookmarks.php
@@ -33,29 +33,29 @@ class OC_Bookmarks_Bookmarks{
* @param filterTagOnly if true, filter affacts only tags, else filter affects url, title and tags
* @return void
*/
- public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly){
+ public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly) {
//OCP\Util::writeLog('bookmarks', 'findBookmarks ' .$offset. ' '.$sqlSortColumn.' '. $filter.' '. $filterTagOnly ,OCP\Util::DEBUG);
$CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' );
$params=array(OCP\USER::getUser());
- if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) {
$_gc_separator = ', \' \'';
} else {
$_gc_separator = 'SEPARATOR \' \'';
}
- if($filter){
+ if($filter) {
if($CONFIG_DBTYPE == 'pgsql' )
$tagString = 'array_to_string(array_agg(tag), \' \')';
else
$tagString = 'tags';
$sqlFilterTag = 'HAVING ';
- if(is_array($filter)){
+ if(is_array($filter)) {
$first = true;
$filterstring = '';
- foreach ($filter as $singleFilter){
+ foreach ($filter as $singleFilter) {
$filterstring = $filterstring . ($first?'':' AND ') . $tagString.' LIKE ? ';
$params[] = '%'.$singleFilter.'%';
$first=false;
@@ -69,7 +69,7 @@ class OC_Bookmarks_Bookmarks{
$sqlFilterTag = '';
}
- if($CONFIG_DBTYPE == 'pgsql' ){
+ if($CONFIG_DBTYPE == 'pgsql' ) {
$query = OCP\DB::prepare('
SELECT `id`, `url`, `title`, '.($filterTagOnly?'':'`url` || `title` ||').' array_to_string(array_agg(`tag`), \' \') as `tags`
FROM `*PREFIX*bookmarks`
diff --git a/lib/search.php b/lib/search.php
index 1e6a3ce9..646a02d0 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -21,14 +21,14 @@
*/
class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
- function search($query){
+ function search($query) {
$results=array();
$offset = 0;
$sqlSortColumn = 'id';
$searchquery=array();
- if(substr_count($query, ' ') > 0){
+ if(substr_count($query, ' ') > 0) {
$searchquery = explode(' ', $query);
}else{
$searchquery = $query;
@@ -38,7 +38,7 @@ class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
$bookmarks = OC_Bookmarks_Bookmarks::findBookmarks($offset, $sqlSortColumn, $searchquery, false);
// OCP\Util::writeLog('bookmarks', 'found ' .count($bookmarks) ,OCP\Util::DEBUG);
//$l = new OC_l10n('bookmarks'); //resulttype can't be localized, javascript relies on that type
- foreach($bookmarks as $bookmark){
+ foreach($bookmarks as $bookmark) {
$results[]=new OC_Search_Result($bookmark['title'],'', $bookmark['url'],'Bookm.');
}
diff --git a/templates/bookmarklet.php b/templates/bookmarklet.php
index 1802814d..f54a5124 100644
--- a/templates/bookmarklet.php
+++ b/templates/bookmarklet.php
@@ -3,6 +3,6 @@
function createBookmarklet() {
$l = OC_L10N::get('bookmarks');
echo '' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . ''
- . ''
+ . ''
. $l->t('Read later') . '';
}