Page 1 of 1

CreateLink with target="_blank"

Posted: Tue Aug 14, 2007 7:57 am
by CNBorn
With $this->CreateLink, How to Create a Link that will be opened in a new Window?

Re: CreateLink with target="_blank"

Posted: Tue Aug 14, 2007 8:26 am
by cyberman
Please look at the API Docs

http://www.cmsmadesimple.org/apidoc/
CreateLink (line 1663)

Returns the xhtml equivalent of an href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
void CreateLink (string $id, string $action, [string $returnid = ''], [string $contents = ''], [string $params = array()], [string $warn_message = ''], [boolean $onlyhref = false], [boolean $inline = false], [string $addttext = ''], [mixed $targetcontentonly = false], [mixed $prettyurl = ''])

    * string $id: The id given to the module on execution
    * string $action: The action that this form should do when the link is clicked
    * string $returnid: The id to eventually return to when the module is finished it's task
    * string $contents: The text that will have to be clicked to follow the link
    * string $params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
    * string $warn_message: Text to display in a javascript warning box. If they click no, the link is not followed by the browser.
    * boolean $onlyhref: A flag to determine if only the href section should be returned
    * boolean $inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
    * string $addttext: Any additional text that should be added into the tag when rendered
$addtext can contain strings like target="_blank" ;).