Bug 1235 - addLinks() not working for plugins
: addLinks() not working for plugins
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.0.0
: PC All
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-29 12:02 UTC by Michael Herger
Modified: 2008-08-18 10:53 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herger 2005-03-29 12:02:16 UTC
I wanted to add a plugin's web page to some other section of the SlimServer's web page. According the 
plugin documentation, this is easily possible:

"Plugins also have the option of adding links to other sections of the SlimServer index page. [..] Links can 
be added using the Slim::Web::Pages::addLinks() method."

This does not seem to work: when I call this method, all (most?) of the other links of the section will 
disappear.
Comment 1 KDF 2005-03-29 12:33:04 UTC
please provide the lines of code that you are using.

MusicMagic and Moodlogic both use this function successfully to add mixerlinks
to browse pages. 
Comment 2 KDF 2005-03-29 12:51:25 UTC
the docs seem to mention using $client->string, which I believe is no longer the
case.  it should be the string token only.
Comment 3 Michael Herger 2005-03-29 12:52:25 UTC
These use the "mixer" section. I tested using the search and browse sections. This is a diff to the RadioIO 
plugin (2278) which adds a simple web page:

Index: /home/mh/eclipse/SVN/Plugins/RadioIO.pm
===================================================================
--- /home/mh/eclipse/SVN/Plugins/RadioIO.pm	(revision 2786)
+++ /home/mh/eclipse/SVN/Plugins/RadioIO.pm	(working copy)
@@ -155,11 +155,27 @@
 	return 'PLUGIN_RADIOIO_MODULE_NAME';
 }
 
+# Web pages
+
+sub webPages {
+    my %pages = ("index\.htm" => \&handleWebIndex);
+	Slim::Web::Pages::addLinks("browse", { 'PLUGIN_RADIOIO_MODULE_TITLE' => "plugins/RadioIO/index.
html" }, 1);
+    return (\%pages, "index.html");
+}
+
+sub handleWebIndex {
+	my ($client, $params) = @_;
+	$params->{'station_names'} = \@station_names;
+
+	return Slim::Web::HTTP::filltemplatefile('plugins/RadioIO/index.html', $params);
+}
+
+
 sub strings
 {
 	return "
 PLUGIN_RADIOIO_MODULE_NAME
-	DE	radioio.com Internet Radio
+	DE	radioio.com - no boundaries.
 	EN	radioio.com - no boundaries.
 	ES	radioio.com - sin límites.
 

Comment 4 KDF 2005-03-29 13:16:27 UTC
moser fixed at r2796