From 7e8b6f32cb70b546a960a82f12c1d1e526202eb1 Mon Sep 17 00:00:00 2001 From: Thomas Renard Date: Thu, 27 Dec 2012 19:57:24 +0100 Subject: [PATCH] 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 99b7a37b..06aeda70 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\" -- 2.39.5