1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-20 17:54:25 +01:00

Merge branch 'master' into bookmark_rework

Conflicts:
	bookmarks/addBm.php
	bookmarks/ajax/editBookmark.php
	bookmarks/bookmarksHelper.php
	bookmarks/lib/bookmarks.php
	bookmarks/lib/search.php
	bookmarks/templates/bookmarklet.php
	bookmarks/templates/list.php
This commit is contained in:
Brice Maron 2012-09-18 19:39:53 +00:00
commit f61dc7cf43
37 changed files with 159 additions and 31 deletions

View File

@ -27,8 +27,7 @@
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('bookmarks');
require_once('bookmarksHelper.php');
require_once 'bookmarksHelper.php';
// Prep screen if we come from the bookmarklet
$url ='';

View File

@ -32,6 +32,6 @@ OCP\JSON::callCheck();
OCP\JSON::checkAppEnabled('bookmarks');
require_once(OC_App::getAppPath('bookmarks').'/bookmarksHelper.php');
require_once OC_App::getAppPath('bookmarks').'/bookmarksHelper.php';
$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
OCP\JSON::success(array('data' => $id));

View File

@ -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();
}

View File

@ -43,4 +43,4 @@ if(isset($_POST['url'])) {
exit();
}
OC_JSON::error();
exit();
exit();

View File

@ -36,4 +36,3 @@ $params=array(OCP\USER::getUser(), htmlspecialchars_decode($_POST["url"]));
$bookmarks = $query->execute($params);
header( "HTTP/1.1 204 No Content" );

View File

@ -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'] ) );

View File

@ -56,7 +56,8 @@ function getURLMetadata($url) {
$url = 'http://' . $url;
}
$metadata['url'] = $url;
if (!function_exists('curl_init')){
if (!function_exists('curl_init')) {
return $metadata;
}
$ch = curl_init();
@ -78,4 +79,4 @@ function analyzeTagRequest($line) {
$filterTag[] = trim($tag);
}
return $filterTag;
}
}

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Adreces d'interès",
"unnamed" => "sense nom",
"Bookm." => "Marcador",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arrossegueu-ho al navegador i feu-hi un clic quan volgueu marcar ràpidament una adreça d'interès:",
"Read later" => "Llegeix més tard",
"Address" => "Adreça",

View File

@ -1,11 +1,12 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Záložky",
"unnamed" => "nepojmenovaný",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Přetáhněte do Vašeho prohlížeče a kliněte, pokud si přejete rychle uložit stranu do záložek:",
"unnamed" => "nepojmenováno",
"Bookm." => "Zál.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Přetáhněte do Vašeho prohlížeče a klikněte, pokud si přejete rychle uložit stránku do záložek:",
"Read later" => "Přečíst později",
"Address" => "Adresa",
"Title" => "Název",
"Tags" => "Tagy",
"Tags" => "Značky",
"Save bookmark" => "Uložit záložku",
"You have no bookmarks" => "Nemáte žádné záložky",
"Bookmarklet <br />" => "Záložky <br />"

13
l10n/da.php Normal file
View File

@ -0,0 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Bogmærker",
"unnamed" => "uden navn",
"Bookm." => "Bogm.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Træk denne til dine browserbogmærker pg klik på den, når du ønsker at lynoprette et bogmærke til hjemmesiden:",
"Read later" => "Læs senere",
"Address" => "Adresser",
"Title" => "Titel",
"Tags" => "Mærker",
"Save bookmark" => "Gem bogmærke",
"You have no bookmarks" => "Du har ingen bogmærker",
"Bookmarklet <br />" => "Bookmarklet <br />"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Lesezeichen",
"unnamed" => "unbenannt",
"Bookm." => "Lesez.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Ziehen Sie dies zu Ihren Browser-Lesezeichen und klicken Sie darauf, wenn Sie eine Website schnell den Lesezeichen hinzufügen wollen.",
"Read later" => "Später lesen",
"Address" => "Adresse",

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Σελιδοδείκτες",
"unnamed" => "ανώνυμο",
"Bookm." => "Σελιδοδεικτ.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Σύρετε αυτό στους σελιδοδείκτες του περιηγητή σας και κάντε κλικ επάνω του, όταν θέλετε να προσθέσετε σύντομα μια ιστοσελίδα ως σελιδοδείκτη:",
"Read later" => "Ανάγνωση αργότερα",
"Address" => "Διεύθυνση",

View File

@ -7,5 +7,6 @@
"Title" => "Titolo",
"Tags" => "Etikedoj",
"Save bookmark" => "Konservi legosignon",
"You have no bookmarks" => "Vi havas neniun legosignon"
"You have no bookmarks" => "Vi havas neniun legosignon",
"Bookmarklet <br />" => "Kodosigno <br />"
);

View File

@ -1,10 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Järjehoidjad",
"unnamed" => "nimetu",
"Bookm." => "Järjeh.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Lohista see oma veebilehitseja järjehoidjatesse ja kliki sellele, kui sa soovid veebilehte kiirelt lisada:",
"Read later" => "Loe hiljem",
"Address" => "Aadress",
"Title" => "Pealkiri",
"Tags" => "Sildid",
"Save bookmark" => "Salvesta järjehoidja",
"You have no bookmarks" => "Sul pole järjehoidjaid"
"You have no bookmarks" => "Sul pole järjehoidjaid",
"Bookmarklet <br />" => "Järjehoidja vidin <br />"
);

View File

@ -4,7 +4,7 @@
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Web orri bat laster-marketara azkar gehitzeko, arrastratu hau zure arakatzailearen laster-marketara eta klikatu bertan:",
"Read later" => "Irakurri geroago",
"Address" => "Helbidea",
"Title" => "Izenbrua",
"Title" => "Izenburua",
"Tags" => "Etiketak",
"Save bookmark" => "Gorde laster-marka",
"You have no bookmarks" => "Ez duzu laster-markarik",

View File

@ -1,8 +1,11 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "نشانک‌ها",
"unnamed" => "بدون‌نام",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "هنگامی که می‌خواهید کی صفحه‌ی اینترنتی را بسرعت نشان کنید، این را به نشانه‌های مرورگر خود بکشید و روی آن کلیک کنید.",
"Read later" => "بعد خوانده‌شود",
"Address" => "آدرس",
"Title" => "عنوان",
"Tags" => "برچسب‌ها",
"Save bookmark" => "ذخیره نشانک",
"You have no bookmarks" => "شما هیچ نشانکی ندارید"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Kirjanmerkit",
"unnamed" => "nimetön",
"Bookm." => "Kirjanm.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Vedä tämä selaimesi kirjanmerkkipalkkiin ja napsauta sitä, kun haluat lisätä kirjanmerkin nopeasti:",
"Read later" => "Lue myöhemmin",
"Address" => "Osoite",

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Favoris",
"unnamed" => "sans titre",
"Bookm." => "Fav.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Glissez ceci dans les favoris de votre navigateur, et cliquer dessus lorsque vous souhaitez ajouter la page en cours à vos marques-pages :",
"Read later" => "Lire plus tard",
"Address" => "Adresse",

11
l10n/he.php Normal file
View File

@ -0,0 +1,11 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "סימניות",
"unnamed" => "ללא שם",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "ניתן לגרור את הקישור הזה אל סרגל הסימניות בדפדפן שלך וללחוץ עליו כאשר מעוניינים ליצור סימניה לאתר במהירות.",
"Read later" => "קריאה מאוחרת",
"Address" => "כתובת",
"Title" => "כותרת",
"Tags" => "תגיות",
"Save bookmark" => "שמירת סימניה",
"You have no bookmarks" => "אין ברשותך סימניות"
);

12
l10n/hu_HU.php Normal file
View File

@ -0,0 +1,12 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Könyvjelzők",
"unnamed" => "névtelen",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Húzd át ezt a böngésződben a Könyvjelzők sávba! Klikkelj rá bármikor, amikor szeretnéd az aktuális weboldal címét ide elmenteni!",
"Read later" => "Később olvasom",
"Address" => "Cím",
"Title" => "Felirat",
"Tags" => "Címkék",
"Save bookmark" => "Könyvjelző mentése",
"You have no bookmarks" => "Nincsenek könyvjelzőid",
"Bookmarklet <br />" => "Könyvjelzőalkalmazás <br />"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Segnalibri",
"unnamed" => "senza nome",
"Bookm." => "Segnal.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Quando vuoi creare rapidamente un segnalibro, trascinalo sui segnalibri del browser e fai clic su di esso:",
"Read later" => "Leggi dopo",
"Address" => "Indirizzo",

13
l10n/ja_JP.php Normal file
View File

@ -0,0 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "ブックマーク",
"unnamed" => "無名タイトル",
"Bookm." => "ブックマーク",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Webページをすぐにブックマークしたい場合は、これをブラウザのブックマークにドラッグし、クリックしてください:",
"Read later" => "後で確認",
"Address" => "アドレス",
"Title" => "タイトル",
"Tags" => "タグ",
"Save bookmark" => "ブックマークを保存",
"You have no bookmarks" => "ブックマークがありません",
"Bookmarklet <br />" => "ブックマークレット <br />"
);

View File

@ -1,11 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Bladwijzers",
"unnamed" => "geen naam",
"Bookm." => "Bladw.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Sleep dit naar uw browser bladwijzers en klik erop, wanneer u een webpagina snel wilt voorzien van een bladwijzer:",
"Read later" => "Lees later",
"Address" => "Adres",
"Title" => "Titel",
"Tags" => "Tags",
"Save bookmark" => "Bewaar bookmark",
"You have no bookmarks" => "U heeft geen bookmarks"
"Save bookmark" => "Bewaar bladwijzer",
"You have no bookmarks" => "U heeft geen bladwijzers",
"Bookmarklet <br />" => "Bookmarklet <br />"
);

13
l10n/pl.php Normal file
View File

@ -0,0 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Zakładki",
"unnamed" => "bez nazwy",
"Bookm." => "Zakładka",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Przeciągnij to do ulubionych przeglądarki i kliknij go, gdy użytkownik chce szybko dodać zakładkę strony sieci Web:",
"Read later" => "Czytaj później",
"Address" => "Adres",
"Title" => "Tytuł",
"Tags" => "Tagi",
"Save bookmark" => "Zapisz zakładkę",
"You have no bookmarks" => "Nie masz żadnych zakładek",
"Bookmarklet <br />" => "Skryptozakładka <br />"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Закладки",
"unnamed" => "без имени",
"Bookm." => "Закл.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Перетащите эту кнопку в закладки вашего браузера и нажимайте на неё для быстрого добавления страницы в закладки:",
"Read later" => "Прочитать позже",
"Address" => "Адрес",

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Zaznamki",
"unnamed" => "neimenovano",
"Bookm." => "Zaznam.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Povlecite gumb med svoje zaznamke in kliknite nanj, ko želite obiskano spletno stran hitro dodati med svoje zaznamke:",
"Read later" => "Preberi kasneje",
"Address" => "Naslov",

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Bokmärken",
"unnamed" => "namnlös",
"Bookm." => "Bokm.",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Dra till din webbläsares bokmärken och klicka på det när du vill bokmärka en webbsida snabbt:",
"Read later" => "Läs senare",
"Address" => "Adress",

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "รายการโปรด",
"unnamed" => "ยังไม่มีชื่อ",
"Bookm." => "รายการโปรด",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "ลากสิ่งนี้ไปไว้ที่รายการโปรดในโปรแกรมบราวเซอร์ของคุณ แล้วคลิกที่นั่น, เมื่อคุณต้องการเก็บหน้าเว็บเพจเข้าไปไว้ในรายการโปรดอย่างรวดเร็ว",
"Read later" => "อ่านภายหลัง",
"Address" => "ที่อยู่",

9
l10n/uk.php Normal file
View File

@ -0,0 +1,9 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Закладки",
"Read later" => "Прочитати пізніше",
"Address" => "Адреса",
"Title" => "Назва",
"Tags" => "Теги",
"Save bookmark" => "Зберегти закладку",
"You have no bookmarks" => "У вас нема закладок"
);

12
l10n/vi.php Normal file
View File

@ -0,0 +1,12 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Đánh dấu",
"unnamed" => "Không tên",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Kéo vào bookmark trình duyệt của bạn và nhấp vào nó, khi bạn muốn đánh dấu một trang web một cách nhanh chóng:",
"Read later" => "Đọc sau",
"Address" => "Địa chỉ",
"Title" => "Tiêu đề",
"Tags" => "Tags",
"Save bookmark" => "Lưu đánh dấu",
"You have no bookmarks" => "Bạn chưa có đánh dấu nào",
"Bookmarklet <br />" => "Bookmarklet <br />"
);

13
l10n/zh_CN.GB2312.php Normal file
View File

@ -0,0 +1,13 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "书签",
"unnamed" => "未命名",
"Bookm." => "订阅它们。",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "拖动此物到您的浏览器书签栏,在您想要快速订阅某网页时点击:",
"Read later" => "稍后阅读",
"Address" => "网址",
"Title" => "标题",
"Tags" => "标签",
"Save bookmark" => "保存书签",
"You have no bookmarks" => "您没有书签",
"Bookmarklet <br />" => "小书签 <br />"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "书签",
"unnamed" => "未命名",
"Bookm." => "书签",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "拖曳此处到您的浏览器书签处,点击可以将网页快速添加到书签中。",
"Read later" => "稍后阅读",
"Address" => "地址",

12
l10n/zh_TW.php Normal file
View File

@ -0,0 +1,12 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "書籤",
"unnamed" => "未命名",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "將此拖曳至您的瀏覽器書籤並點擊, 當你想要將網頁快速地加入書籤:",
"Read later" => "稍後閱讀",
"Address" => "網址",
"Title" => "標題",
"Tags" => "標籤",
"Save bookmark" => "儲存書籤",
"You have no bookmarks" => "你沒有書籤",
"Bookmarklet <br />" => "書籤小工具"
);

View File

@ -56,7 +56,7 @@ class OC_Bookmarks_Bookmarks{
* @param filterTagOnly if true, filter affects only tags, else filter affects url, title and tags
* @return void
*/
public static function findBookmarks($offset, $sqlSortColumn, $filters, $filterTagOnly){
public static function findBookmarks($offset, $sqlSortColumn, $filters, $filterTagOnly) {
$CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' );
if(is_string($filters)) $filters = array($filters);

View File

@ -21,11 +21,12 @@
*/
class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
function search($query){
function search($query) {
$l=OC_L10N::get('bookmarks');
$results=array();
$search_words=array();
if(substr_count($query, ' ') > 0){
if(substr_count($query, ' ') > 0) {
$search_words = explode(' ', $query);
}else{
$search_words = $query;
@ -33,8 +34,8 @@ class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
$bookmarks = OC_Bookmarks_Bookmarks::searchBookmarks($search_words);
$l = new OC_l10n('bookmarks'); //resulttype can't be localized, javascript relies on that type
foreach($bookmarks as $bookmark){
$results[]=new OC_Search_Result($bookmark['title'],'', $bookmark['url'],$l->t('Bookm.'));
foreach($bookmarks as $bookmark) {
$results[]=new OC_Search_Result($bookmark['title'],'', $bookmark['url'], $l->t('Bookm.'));
}
return $results;

View File

@ -34,14 +34,13 @@
</ul>
</div>
<div id="rightcontent" class="rightcontent">
<div class="bookmarks_list"></div>
<div id="firstrun" style="display: none;">
<?php
echo $l->t('You have no bookmarks');
$embedded = true;
require_once(OC_App::getAppPath('bookmarks') .'/templates/bookmarklet.php');
require_once OC_App::getAppPath('bookmarks') .'/templates/bookmarklet.php' ;
createBookmarklet();
?>
</div>

View File

@ -10,7 +10,7 @@
<fieldset class="personalblock">
<span class="bold"><?php echo $l->t('Bookmarklet <br />');?></span>
<?php
require_once('bookmarklet.php');
require_once 'bookmarklet.php';
createBookmarklet();
?>
</fieldset>
@ -29,4 +29,4 @@
</p>
<input type="submit" name="bm_import" value="<?php echo $l->t('Import'); ?>" />
</fieldset>
</form>
</form>