function createlink better formatting

General project discussion. NOT for help questions.
Post Reply
piratos

function createlink better formatting

Post by piratos »

Hi wishy !

I use by myself a changed version of function createlink from class.module.inc.php.

This is the changed part:

Code: Select all

function CreateLink($id, $action, $returnid='', $contents='', $params=array(), $warn_message='', $onlyhref=false, $inline=false, $addttext='')
	{
		debug_buffer($addttext);
		$text = '';
		$goto = 'moduleinterface.php';
		$class = $params['class'];
		if ($inline && $returnid != '')
		{
			$goto = 'index.php';
		}
		if (!$onlyhref)
		{
                    if (strlen($class)>0)
                    {
                      $text .='<a class="'.$class.'" href="';
                    }else
		    {
                      $text .= '<a href="';
                    }
		}
Now i can as example create in my modules a separate class for each link if i wish. I only need to set the parameter class in the function call.

I mean this changes are good for all. What do you mean ?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: function createlink better formatting

Post by Ted »

I agree.  It's on the TODO list.
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: function createlink better formatting

Post by nils73 »

Optional parameter title would also be nice --- comes in handy when you need to supply additional information.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: function createlink better formatting

Post by Ted »

I just committed this change to svn.  Thanks.
Post Reply

Return to “General Discussion”