eZ Community » Forums » General » Suscribing to a course #2
expandshrink

Suscribing to a course #2

Suscribing to a course #2

Saturday 11 October 2003 11:45:56 pm - 2 replies

I'm still confronted with one problem:
I want a user, who is logged in, to suscribe to a course. For doing that, Eirik Johansen told me, i should use the "placements of object" feature. I think he means, that i should create a node of the user under the course object. Doing this manually in the admin interface works, but i still don't know, how to do this with only one click.

I am searching for a code (in my template), i think this should be a form, where i can provide a button for the user, and if he clicks, his node should be placed under the courseobject where he is in. What i already know is the $current_user.contentobject.id and the $node.node_id, where the copy of the user should be copied to.

What i don't know, is the code for the form, and if it is possible to create a new node without getting through the 'create a new draft' ...

Thank you very much, Thomas

ps: the first topic where eirik helped me you find http://ez.no/developer/ez_publish...rum/developer/suscribing_to_a_course . I don't publish my question there, because i think it's not a developer question anymore.

Tuesday 14 October 2003 10:39:23 pm

I'm afraid i will jump out of the window the next moment ... I don't get this thing working sad.gif Emoticon
What i found out in
http://www.ez.no/developer/ez_pub.../pass_additional_information_to_cart
is the possibility to bring back my $setCourseID variable in the template, but i don't get it working with the user/edit module.

If i am thinking correct, the /user/edit.php calls the /content/edit.php, and i want to take my variable from the <input type="hidden" name="setCourseID" ...> in my template file through the user/edit.php to content/edit.php and then use {$setCourseID} in my content/edit.tpl file to show my variable there.

Can someone help me here??
Kind Regards, Thomas

Thursday 16 October 2003 1:16:16 am

Another try doesn't work:
My course.tpl File has a form and should transfer the $node.node_id to the /content/edit.tpl. I try it this way:

<input type="hidden" name="setCourseID" value="{$node.node_id}" />

I stored my setCourseID in my user/edit.php in a session variable:

if ( $Module->isCurrentAction( "Edit" ) )
{
if ( $http->hasPostVariable( 'setCourseID' ) )
{
$setCourseID = $http->postVariable( 'setCourseID' );
$http->setSessionVariable( 'setCourseID', $setCourseID );
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
else
{
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
}

Then, i added these Lines to user/attribute_edit.php:

if ( $http->hasSessionVariable( 'setCourseID' ) )
{
$setCourseID = $http->sessionVariable( 'setCourseID' );
$tpl->setVariable( 'setCourseID', $setCourseID );
}

But i still don't get any attribute in /content/edit.tpl with {$setCourseID}

Modified on Thursday 16 October 2003 1:18:00 am by Thomas Schamm

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from