From a98cd5c5264a482bb2d6daf3b3dbedf32c5a1d8e Mon Sep 17 00:00:00 2001 From: Thomas Renard Date: Thu, 27 Dec 2012 13:08:23 +0100 Subject: [PATCH 1/6] OWNCLOUD_URL parameter in config.php-dist --- config.php-dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.php-dist b/config.php-dist index e0949c61e..db6ec661f 100644 --- a/config.php-dist +++ b/config.php-dist @@ -176,6 +176,11 @@ // Displays an URL for users to provide feedback or comments regarding // this instance of tt-rss. Can lead to a forum, contact email, etc. + define('OWNCLOUD_URL', ''); + // owncloud-plugin: + // This is the base url of your owncloud server as called from the browser + // Actually this is a server global parameter only + define('CONFIG_VERSION', 26); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). From 741ff8f405a8556c6c8be360a10a71b735b7ce41 Mon Sep 17 00:00:00 2001 From: Thomas Renard Date: Thu, 27 Dec 2012 13:35:24 +0100 Subject: [PATCH 2/6] OWNCLOUD_URL-parameter out of config.php-dist Comment in plugins/owncloud/owncloud.php --- config.php-dist | 5 ----- plugins/owncloud/owncloud.php | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config.php-dist b/config.php-dist index db6ec661f..e0949c61e 100644 --- a/config.php-dist +++ b/config.php-dist @@ -176,11 +176,6 @@ // Displays an URL for users to provide feedback or comments regarding // this instance of tt-rss. Can lead to a forum, contact email, etc. - define('OWNCLOUD_URL', ''); - // owncloud-plugin: - // This is the base url of your owncloud server as called from the browser - // Actually this is a server global parameter only - define('CONFIG_VERSION', 26); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). diff --git a/plugins/owncloud/owncloud.php b/plugins/owncloud/owncloud.php index e63ff959c..d7007e0f0 100644 --- a/plugins/owncloud/owncloud.php +++ b/plugins/owncloud/owncloud.php @@ -1,4 +1,10 @@ Date: Thu, 27 Dec 2012 13:41:29 +0100 Subject: [PATCH 3/6] the '/' is needed for some servers --- plugins/owncloud/owncloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/owncloud/owncloud.php b/plugins/owncloud/owncloud.php index d7007e0f0..99b7a37bd 100644 --- a/plugins/owncloud/owncloud.php +++ b/plugins/owncloud/owncloud.php @@ -1,7 +1,7 @@ Date: Thu, 27 Dec 2012 19:57:24 +0100 Subject: [PATCH 4/6] Preferences panel for owncloud (not tested yet) --- plugins/owncloud/owncloud.php | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/plugins/owncloud/owncloud.php b/plugins/owncloud/owncloud.php index 99b7a37bd..06aeda705 100644 --- a/plugins/owncloud/owncloud.php +++ b/plugins/owncloud/owncloud.php @@ -22,12 +22,58 @@ 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 ""; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
".__("Owncloud url")."
"; + print "

"; + + print "

"; + + print "
"; #pane + + } + function hook_article_button($line) { return "link, "plugins/owncloud/owncloud.png")."\" style=\"cursor : pointer\" style=\"cursor : pointer\" From 7278dc0edf3b7b06edb5e3abd301da588f12d128 Mon Sep 17 00:00:00 2001 From: Thomas Renard Date: Fri, 28 Dec 2012 00:57:36 +0100 Subject: [PATCH 5/6] save owncloud url as plugin pref --- plugins/owncloud/owncloud.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/plugins/owncloud/owncloud.php b/plugins/owncloud/owncloud.php index 06aeda705..6643d0ae4 100644 --- a/plugins/owncloud/owncloud.php +++ b/plugins/owncloud/owncloud.php @@ -38,7 +38,7 @@ class OwnCloud extends Plugin { function hook_prefs_tab($args) { if ($args != "prefPrefs") return; - print "
"; + print "
"; print "
"; @@ -46,9 +46,9 @@ class OwnCloud extends Plugin { print "
"; print "