1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-19 15:52:10 +01:00

[Bookmark] More style fix

This commit is contained in:
Brice Maron 2012-10-10 19:29:08 +00:00
parent 4405797476
commit 8949278e83
3 changed files with 18 additions and 10 deletions

View File

@ -31,8 +31,8 @@ require_once 'bookmarksHelper.php';
// Prep screen if we come from the bookmarklet // Prep screen if we come from the bookmarklet
$url =''; $url ='';
if(isset($_GET['url']) ){ if(isset($_GET['url'])) {
$url = $_GET['url']; $url = $_GET['url'];
} }
if(!isset($_GET['title']) || trim($_GET['title']) == '') { if(!isset($_GET['title']) || trim($_GET['title']) == '') {
$datas = getURLMetadata($url); $datas = getURLMetadata($url);

View File

@ -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'; OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php';
$l = new OC_l10n('bookmarks'); $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\App::registerPersonal('bookmarks', 'settings');
OCP\Util::addscript('bookmarks','bookmarksearch'); OCP\Util::addscript('bookmarks', 'bookmarksearch');
OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); OC_Search::registerProvider('OC_Search_Provider_Bookmarks');

View File

@ -21,8 +21,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
$ids2 = $this->content->copyRows( $options ); $ids2 = $this->content->copyRows( $options );
// If both returned some ids then they worked // If both returned some ids then they worked
if( is_array( $ids ) && is_array( $ids2 ) ) if( is_array( $ids ) && is_array( $ids2 ) ) {
{
return true; return true;
} else { } else {
return false; return false;
@ -40,8 +39,13 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
$idmap = array(); $idmap = array();
while( $row = $results->fetchRow() ) { while( $row = $results->fetchRow() ) {
// Import each bookmark, saving its id into the map // 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 (?, ?, ?, ?, ?, ?)" ); $sql = "INSERT INTO `*PREFIX*bookmarks`
$query->execute( array( $row['url'], $row['title'], $this->uid, $row['public'], $row['added'], $row['lastmodified'] ) ); (`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 // Map the id
$idmap[$row['id']] = OCP\DB::insertid(); $idmap[$row['id']] = OCP\DB::insertid();
} }
@ -56,7 +60,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
} }
} }
// All done! // All done!
break; break;
} }
return true; return true;