New window for printing?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
saltydog
Power Poster
Power Poster
Posts: 281
Joined: Fri Mar 04, 2005 9:06 am

New window for printing?

Post by saltydog »

I'd like to change the behaviour of the "print" plugin. Instead of opening the content for printing in the same window, is it possiible to open it in a new window, so that the user can print and then close, instead of "going back"? Further to this, when printing, it is printed also the "Go Back" button on top of the page, and this is not good. Removinf the button, the user can get confused on what to do, that's the reason why to open it in a new window.
I have seen the code in /lib/content.functions.php and I have just added a "text-align:justify;" to the printing code, but I don't know how to open it in a new window (maybe just few lines of javascript should be enough..)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: New window for printing?

Post by Ted »

Modify the code in plugins/function.print.php as so:

Code: Select all

        if (isset($params["showbutton"]))
        {
                return '<a href="index.php?page='.$gCms->variables['page_name'].'&print=true" target="_blank"><img border="0" src="images/cms/printbutton.gif" alt="'.$text.'"/></a>';
        }
        else
        {
                return '<a href="index.php?page='.$gCms->variables['page_name'].'&print=true" target="_blank">'.$text.'</a>';
        }
Post Reply

Return to “CMSMS Core”