Want to add a function to a button that are in library-section. (vers:1.2.2)

Asked by Marcus Hultqvist

Hello!

i want to add a button in the library where the user can get a small preview popup when user click the button. I copied the code from the existing buttons and just changed a little but, so right now it is: "$buttons .= "<button class='mxdsFormButton' title='$msgPreview' href='index.php?p=module&mod=$mediatype&q=Exec&method=PreviewForm&mediaid=$mediaid'><span>$msgPreview</span></button>";"

I added that row in content.class.php on row 288. So, where does i write "the function for the button"? Because now when i click it it says: The module does not exist.

I havent managed to find the code even for the delete and edit button.

So, where does i write the code that runs when a user clicks my button?

I am using version 1.2.2.

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

Each media type is driven by a different module, these are location in modules/<type>.class.php

There is a base class that is inherited by them all in lib/modules/module.class.php

I would suggest adding a base class function for PreviewForm that returns an empty form (catch all) and then the same method again in each of the image/video/flash/powerpoint module classes.

Revision history for this message
Marcus Hultqvist (tulken-hultan) said :
#2

Ok, ive read a little here: http://php.net/manual/en/language.oop5.basic.php and i think i understand what u mean.

but i´m not really sure how to write the code so its popups a preview on the screen when the button is pressed and where it should be placed. Would that be something that you can help me with?

Revision history for this message
Dan Garner (dangarner) said :
#3

If things were a little quieter i'd be happy to help, unfortunately Xibo keeps us very very busy just answering questions! If you can't work out how to do it, submit it as a blueprint and it will be looked at for future developments.

(It is actually quite easy, just write your method in each module file, and it will be done. The method should return some HTML by setting the ResponseManager object - there are a ton of examples in the code)

Can you help with this problem?

Provide an answer of your own, or ask Marcus Hultqvist for more information if necessary.

To post a message you must log in.