Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 8:19 am (All times are UTC )

 


Forum rules

Please submit all new Tips and Tricks to: http://docs.joomla.org/Category:Tips_and_tricks



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
Posted: Sat May 06, 2006 9:24 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Nov 10, 2005 10:08 am
Posts: 807
From a thread in the dev forum (http://forum.joomla.org/index.php/topic,41153)

I don't know if anything was written about this, so I wrote it myself.

Code:
<?php
global $option;

global $hide_js;
// if joomla is called with ?hide_js=1 in the URL, PrintIcon won't work
// if you want to ignore this setting, use the following line instead:
// $hide_js = 1;

$popup = intval( mosGetParam( $_REQUEST, 'popup', 0 ) );

$row = new stdClass; // I don't think $row is used at all.

$params = new mosParameters( '' );

// if set to 0, there won't be a print icon at all
$params->set( 'print', '1' );

// set to 0 to use text instead of icon.
$params->set( 'icons', '1' );

// if set to 1, this will invoke the browser's print function.
$params->set( 'popup', $popup );

// lookup sefRelToAbs in the forum if you don't know what it does.
$link = sefRelToAbs ( 'index2.php?option='.$option.'&popup=1&yourparam=value' );

// if you set status to NULL, or omit it completely,
//these default settings for the print window will be used.
$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,'
       .'resizable=yes,width=640,height=480,directories=no,location=no';


mosHTML::PrintIcon( $row, $params, $hide_js, $link, $status )

?>

_________________
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework


Last edited by mcsmom on Sat Oct 06, 2007 12:22 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Fri Feb 23, 2007 2:30 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 8:55 pm
Posts: 12895
Location: Nijmegen, The Netherlands
Thanks for sharing this info!

Do you know by any chance how to create a custom background in the pop-up screen?
(or how to disable template_css so that the background isn't used in the pop-up)?

For people reading your code, sefRelToAbs converts all links in CMTs to SEF links.
Info: http://forum.joomla.org/index.php/topic,1500.0.html

_________________
Kind Regards,
Peter Martin, Global Moderator - Community & Leadership Team
www.db8.nl - Joomla specialist, Nijmegen, Nederland
Joomla 1.5 Quick Reference Guide: www.db8.nl/en/downloads/misc-downloads/ ... glish.html


Last edited by pe7er on Fri Feb 23, 2007 2:34 pm, edited 1 time in total.

Top
   
 
Posted: Fri Feb 23, 2007 4:04 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Nov 10, 2005 10:08 am
Posts: 807
Use [php]$mainframe->addCustomHeadTag()[/php] to add a css file to the popup's html. The css can override anyhting that's in the template's css.
[php]
/**
* Adds a custom html string to the head block
* @param string The html to add to the head
*/
function addCustomHeadTag( $html )[/php]

It should be noted that all of this is for J!1.0.x (or 1.5 with legacy mode)

_________________
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework


Top
  E-mail  
 
Posted: Fri Feb 23, 2007 4:57 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 8:55 pm
Posts: 12895
Location: Nijmegen, The Netherlands
Thanks!

_________________
Kind Regards,
Peter Martin, Global Moderator - Community & Leadership Team
www.db8.nl - Joomla specialist, Nijmegen, Nederland
Joomla 1.5 Quick Reference Guide: www.db8.nl/en/downloads/misc-downloads/ ... glish.html


Top
   
 
Posted: Tue Feb 27, 2007 3:58 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 5759
Location: New York
Lets say I wanted to add this to a 3rd Party component. Where would I put it?

_________________
Read your words before posting and think about how other people will read them.
Be polite. Be kind. Be constructive. Say thank you.
Freedom-Equality-Trust-Community-Collaboration-Usability
http://opensourcematters.org/index.php?Itemid=134


Top
   
 
Posted: Tue Feb 27, 2007 4:44 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 8:55 pm
Posts: 12895
Location: Nijmegen, The Netherlands
I've put it at the place where I wanted a Print Icon + functionality.
I used the code at three different places, but you might put it in a new function and call that function from the places where you need the Print Icon.

_________________
Kind Regards,
Peter Martin, Global Moderator - Community & Leadership Team
www.db8.nl - Joomla specialist, Nijmegen, Nederland
Joomla 1.5 Quick Reference Guide: www.db8.nl/en/downloads/misc-downloads/ ... glish.html


Top
   
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group