This topic is locked

Phprunner v5 {if $testcondition} {/if}

9/22/2008 4:12:50 AM
PHPRunner General questions
J
johan-v author

Hello,
Can we still use {if $testcondition} {/if} in the visual editor in version 5?
I would like to disable or enable the edit link in the list page.
Where can we find info about the {BEGIN ...} {END ... } smarty tags?
I lost a bit my orientation in the new version.
greetings,
Johan

Sergey Kornilov admin 9/22/2008

Johan,
documentation on new visual templates tags will be available in final version of PHPRunner.
We dropping all conditional tags moving logic to PHP code. This makes visual templates more stable and allows to avoid "Reset" issues.

J
johan-v author 9/22/2008

Johan,

documentation on new visual templates tags will be available in final version of PHPRunner.
We dropping all conditional tags moving logic to PHP code. This makes visual templates more stable and allows to avoid "Reset" issues.


Hello,
Will this change make it more difficult to program or will it become easier then before?

I have no clue how I will be able to update my existing version 4 project if those conditional tags are gone.
greetings,
Johan

J
johan-v author 9/23/2008

Hello,
Is it possible to get some info about this please?
greetings
Johan

Sergey Kornilov admin 9/23/2008

Johan,
you don't have to worry about existing projects. PHPRunner 5.0 supports both Smarty (for existing projects) and it's own, simplified template language for new projects.

J
johan-v author 9/25/2008

Johan,

you don't have to worry about existing projects. PHPRunner 5.0 supports both Smarty (for existing projects) and it's own, simplified template language for new projects.


Hello,
I still have a problem understanding the new things.

I tried to recreate a previous (v4) project from scratch in v5 but here I could not use the {if $testcondition]

When I just load the previous(v4) project in v5 I'm able to build the project without problems.
So is the following right?

When v5 detects a project was build with v4 it leaves all source untouched and build as if it was v4.
greetings,
Johan

Sergey Kornilov admin 9/25/2008

Yes, this is what I'm trying to communicate.
If you create a new project in V5 your logic need to reside on the server side.

J
johan-v author 9/26/2008

Yes, this is what I'm trying to communicate.

If you create a new project in V5 your logic need to reside on the server side.


Hello,
Now I got it.

Hope we will get the documetation very soon.
greetings,
Johan

N
nix386 10/14/2008

I too have a need to do this (if condition to display the add button or not dependent on if the user is coming from a master table)
Previously I used something like this to great affect and if there is a way to do this using version 5 I would greatly appreciate some advise.

Add button code on the detail list page

{if addnew}<SPAN class=buttonborder><INPUT class=button type=button value="Add new"></SPAN>{/if}
function BeforeShowList(&$smarty,&$templatefile)

{

//display add button if coming from a master record for new doctor

if (@$_REQUEST["masterkey1"])

{

$smarty->assign("addnew",1);

}

else

{

$smarty->assign("addnew",0);

}


Nick

J
Jane 10/14/2008

Nick,
use following code in the List page: Before display event for PHPRunner 5.0:

global $xt;

if (@$_REQUEST["masterkey1"])

{

$xt->assign("add_link",1);

}

else

{

$xt->assign("add_link",0);

}

N
nix386 10/14/2008

Nick,

use following code in the List page: Before display event for PHPRunner 5.0:


Jane, you are awesome!! although the code above did not work in my instance it pointed me in the right direction and if anyone else is interested this is what I used.

global $xt;

if (@$_REQUEST["masterkey1"])

{

$xt->assign("newrecord_controls",true);

}

else

{

$xt->assign("newrecord_controls",false);

}



Many thanks again, Nick