The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jul 31, 2012 2:34 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 23, 2011 5:53 am
Posts: 8
Location: nairobi, kenya
I am developing a booking extensions with a plugin contain a Book Now Button that will be placed on specific articles with the website. The button plugin is supposed to grab the page tittle, page url in hidden form elements and pass it on to the booking form so that when the email is sent out it is easier to know which page the user was on.

It easier to capture that in my plugin with the following code. The complicated part is to get the actual booking form to show in a modal window showing page title, and page url on the pop window.


$form .='<form action="' . $uri->toString( ) . '" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
<input type="submit" name="submit" value="Submit" class="button" id="stf_submitbutton" />
<input type="hidden" name="view" value="bookingview" />
<input type="hidden" name="layout" value="book_layout" />
<input type="hidden" name="option" value="com_xxx" />
<input type="hidden" name="articleId" value="'.$ArticleID.'" />
<input type="hidden" name="articletitle" value="'.$ArticleTitle.'" />
<input type="hidden" name="articleId" value="'.$ArticleID.'" />

</form>';

$stf = '<div id="stf">' . "\n" . $form . "\n" . '</div>';

// REPLACE {sendtofriend} tag with STF
$text = JString::str_ireplace('{booknow}', $stf, $text);


For the pop to show i am using
$link = 'index.php?&option=com_bookingcomponent&amp;view=bookview&amp;layout=book_layout&amp;tmpl=component&amp;id='.$ArticleID;

and passing it here

<a class="modal" onClick href="'.$link.'" rel="{handler: \'iframe\', size:{x: 600, y: 500}}">'.JText::_('Request Info').'</a>

here it get very mess. i can't display the hidden elements in the form. How do i get it working.


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 7:26 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 23, 2011 5:53 am
Posts: 8
Location: nairobi, kenya
Who will come to my rescue??


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 10:57 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 23, 2011 5:53 am
Posts: 8
Location: nairobi, kenya
Finally i figured it out all by myself, i applaud me efoort. So all i need to do was
$url= $uri->toString( );
$link = 'index.php?&option=com_mycomponet&amp;view=myview&amp;layout=mylaoyut&amp;tmpl=component&amp;Variable1='.$vars1.'&amp;Variable1='.$vars2;

$html =' <a class="modal input" href="'.$link.'" rel="{handler: \'iframe\', size:{x: 600, y: 500}}">Click Me</a>' ;

$stf = '<div id="shell">' . "\n" . $html. "\n" . '</div>';


Damn I have 1 strand of hair left on my head for this answer. eeeeeeheeeeeee


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 



Who is online

Users browsing this forum: No registered users and 5 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® Forum Software © phpBB Group