mod_quickicon

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Gedu
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Oct 08, 2007 3:36 pm

mod_quickicon

Post by Gedu » Tue Apr 22, 2008 11:29 am

Hi,

I'm writing a component and I would like to place icons in the administrator layout.
How the mod_quickicon works? How can I call the quickiconButton() function?

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23505
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: mod_quickicon

Post by pe7er » Tue Apr 22, 2008 12:20 pm

Yes, you can, but you'll have to define $link first...
First you'd better back-up the administrator\modules\mod_quickicon\mod_quickicon.php file.
Find

Code: Select all

		<?php
		$link = 'index.php?option=com_content&task=add';
		quickiconButton( $link, 'icon-48-article-add.png', JText::_( 'Add New Article' ) );
and change to

Code: Select all

		<?php
		$link = 'index.php?option=com_some_component_name&task=some_task';
		quickiconButton( $link, 'some_image.png', JText::_( 'Some title' ) );

		$link = 'index.php?option=com_content&task=add';
		quickiconButton( $link, 'icon-48-article-add.png', JText::_( 'Add New Article' ) );
where some_image.png is an 48x48 px image located in \administrator\images .png
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

Gedu
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Oct 08, 2007 3:36 pm

Re: mod_quickicon

Post by Gedu » Tue Apr 22, 2008 3:53 pm

Thanks for the quick reply, but... :)

Here's my code from my component. It's in the default.php in View folder:

Code: Select all

<?php
	$link = "index2.php?option=com_cimovieplayer&task=movielist";
	quickiconButton( $link, "upload_f2.png", JText::_('Manage Movies') );
?>
And here's my error message:
Fatal error: Call to undefined function quickiconButton() in C:\.......

That's my problem. I would like to use some default Joomla 1.5 icon in my component.
How can I define this function?

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23505
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: mod_quickicon

Post by pe7er » Tue Apr 22, 2008 4:02 pm

Gedu wrote:[..] It's in the default.php in View folder:
What happens if you put your code in administrator\modules\mod_quickicon\mod_quickicon.php (which is in fact a small Joomla core hack)?
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

Gedu
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Oct 08, 2007 3:36 pm

Re: mod_quickicon

Post by Gedu » Wed Apr 23, 2008 10:45 am

I don't like to change anything in the Joomla system. I would like to use this component on many site. I think I'will forget how to solved this problem once.

I'm going to write a simple <a> with <img> in my code. I've just wanted to call a system function...

Thanks for your help.

rickystanley
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Thu Apr 24, 2008 9:58 am

Re: mod_quickicon

Post by rickystanley » Wed May 20, 2009 9:51 am

Hey Gedu
put this function on top of your default.php

function quickiconButton( $link, $image, $text )
{
global $mainframe;
$lang =& JFactory::getLanguage();
$template = $mainframe->getTemplate();
?>
<div style="float:<?php echo ($lang->isRTL()) ? 'right' : 'left'; ?>;">
<div class="icon">
<a href="<?php echo $link; ?>">
<?php echo JHTML::_('image.site', $image, '/components/com_proassist/images/', NULL, NULL, $text ); ?>
<span><?php echo $text; ?></span></a>
</div>
</div>
<?php
}

And then

Code:
<?php
$link = "index2.php?option=com_cimovieplayer&task=movielist";
quickiconButton( $link, "upload_f2.png", JText::_('Manage Movies') );
?>

that's way i solved the problem, i also had the problem like u have.
Thanks
//Ricky

Gedu
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Oct 08, 2007 3:36 pm

Re: mod_quickicon

Post by Gedu » Wed May 20, 2009 2:45 pm

Hi Ricky,

I already solved this problem on a similar way you wrote.

Thank you anyway ;)


Locked

Return to “Extensions for Joomla! 1.5”