diff --git a/include/functions.php b/include/functions.php
index ac9cce90f..68271ff73 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1,6 +1,6 @@
">
+
+
diff --git a/plugins/owncloud/owncloud.php b/plugins/owncloud/owncloud.php
index e63ff959c..b846241b8 100644
--- a/plugins/owncloud/owncloud.php
+++ b/plugins/owncloud/owncloud.php
@@ -16,12 +16,57 @@ class OwnCloud extends Plugin {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
+ $host->add_hook($host::HOOK_PREFS_TAB, $this);
+ }
+
+ function save() {
+ $owncloud_url = db_escape_string($_POST["owncloud_url"]);
+ $this->host->set($this, "owncloud", $owncloud_url);
+ echo "Value set to $owncloud_url";
}
function get_js() {
return file_get_contents(dirname(__FILE__) . "/owncloud.js");
}
+ function hook_prefs_tab($args) {
+ if ($args != "prefPrefs") return;
+
+ print "";
+
+ print "
";
+
+ $value = $this->host->get($this, "owncloud");
+ print "
";
+
+ print "
"; #pane
+
+ }
+
function hook_article_button($line) {
return "link, "plugins/owncloud/owncloud.png")."\"
style=\"cursor : pointer\" style=\"cursor : pointer\"
@@ -31,21 +76,18 @@ class OwnCloud extends Plugin {
function getOwnCloud() {
$id = db_escape_string($_REQUEST['id']);
-
+
$result = db_query($this->link, "SELECT title, link
FROM ttrss_entries, ttrss_user_entries
WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
+
if (db_num_rows($result) != 0) {
$title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
100, '...');
$article_link = db_fetch_result($result, 0, 'link');
}
-
- $own_url = "";
- if (defined('OWNCLOUD_URL')) {
- $own_url = OWNCLOUD_URL;
- }
+
+ $own_url = $this->host->get($this, "owncloud");
print json_encode(array("title" => $title, "link" => $article_link,
"id" => $id, "ownurl" => $own_url));
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql
index d4531308f..10320b5b7 100644
--- a/schema/ttrss_schema_mysql.sql
+++ b/schema/ttrss_schema_mysql.sql
@@ -309,7 +309,7 @@ create table ttrss_tags (id integer primary key auto_increment,
create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (101);
+insert into ttrss_version values (102);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
@@ -455,6 +455,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_ENABLED_PLUGINS', 2, '', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', '', 1);
+
update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED',
'SORT_HEADLINES_BY_FEED_DATE',
'VFEED_GROUP_BY_FEED',
diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql
index f52d4191d..33c32d181 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -257,7 +257,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id);
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (101);
+insert into ttrss_version values (102);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
@@ -395,6 +395,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_ENABLED_PLUGINS', 2, '', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', '', 1);
+
update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED',
'SORT_HEADLINES_BY_FEED_DATE',
'VFEED_GROUP_BY_FEED',
diff --git a/schema/versions/mysql/102.sql b/schema/versions/mysql/102.sql
new file mode 100644
index 000000000..ccf5ef3b3
--- /dev/null
+++ b/schema/versions/mysql/102.sql
@@ -0,0 +1,7 @@
+begin;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', '', 1);
+
+update ttrss_version set schema_version = 102;
+
+commit;
diff --git a/schema/versions/pgsql/102.sql b/schema/versions/pgsql/102.sql
new file mode 100644
index 000000000..ccf5ef3b3
--- /dev/null
+++ b/schema/versions/pgsql/102.sql
@@ -0,0 +1,7 @@
+begin;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', '', 1);
+
+update ttrss_version set schema_version = 102;
+
+commit;