diff --git a/addBm.php b/addBm.php index 12071022..f56ebb4f 100644 --- a/addBm.php +++ b/addBm.php @@ -31,8 +31,8 @@ require_once 'bookmarksHelper.php'; // Prep screen if we come from the bookmarklet $url =''; -if(isset($_GET['url']) ){ - $url = $_GET['url']; +if(isset($_GET['url'])) { + $url = $_GET['url']; } if(!isset($_GET['title']) || trim($_GET['title']) == '') { $datas = getURLMetadata($url); diff --git a/appinfo/app.php b/appinfo/app.php index f4bca9df..1b4e1ddf 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -11,9 +11,13 @@ OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php'; OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php'; $l = new OC_l10n('bookmarks'); -OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); +OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', + 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), + 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), + 'name' => $l->t('Bookmarks') +)); OCP\App::registerPersonal('bookmarks', 'settings'); -OCP\Util::addscript('bookmarks','bookmarksearch'); +OCP\Util::addscript('bookmarks', 'bookmarksearch'); OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); diff --git a/appinfo/migrate.php b/appinfo/migrate.php index f8a037b3..a1e0680b 100644 --- a/appinfo/migrate.php +++ b/appinfo/migrate.php @@ -21,8 +21,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ $ids2 = $this->content->copyRows( $options ); // If both returned some ids then they worked - if( is_array( $ids ) && is_array( $ids2 ) ) - { + if( is_array( $ids ) && is_array( $ids2 ) ) { return true; } else { return false; @@ -39,9 +38,14 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ $results = $query->execute( array( $this->olduid ) ); $idmap = array(); 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'] ) ); + // Import each bookmark, saving its id into the map + $sql = "INSERT INTO `*PREFIX*bookmarks` + (`url`, `title`, `user_id`, `public`, `added`, `lastmodified`) VALUES (?, ?, ?, ?, ?, ?)" ; + $query = OCP\DB::prepare($sql; + $query->execute(array( + $row['url'], $row['title'], $this->uid, $row['public'], + $row['added'], $row['lastmodified'] + ) ); // Map the id $idmap[$row['id']] = OCP\DB::insertid(); } @@ -56,7 +60,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ } } // All done! - break; + break; } return true;