This topic is locked

Change Back to Master Link into a button?

5/31/2010 3:03:48 AM
PHPRunner General questions
N
nix386 author

Hello, I have recently upgraded to 5.2 and once I moved my 5.1 project across I found that my custom changes no longer work!

Does anyone know how I can accomplish the same thing in phpr 5.2? I've been trying to solve this and have found the back the code in /phprunner/source/classes/listpage.php but it's changed significantly and I'm pulling hair trying to work out what changes need to be made, alternately there may be a better way to do this?
Original Thread

http://www.asprunner.com/forums/topic/13656-changing-back-to-master-link-to-a-button



Posted 29 January 2010 - 03:50 PM

Hello fellow PHPRunners!
I have a need to change the back to master list link to a button instead of the ordinary text link.
I have tried to change this in the template layout for my project which appears to work but when clicked nothing happens.
This is the original code for the back to master list link in the lheader.htm

if @TABLE.arrMasterTables.len##

{BEGIN mastertable_block}

<div id="mastertable_block{$id}">

{$showmasterfile}

<a {$backtomasterlink_attrs} class="toplinks"><b>##message BACK_TO_MASTER##</b></a>



</div>

{END mastertable_block}

endif##


This is what I have replaced it with but I should also mention I have removed this from the lheader.htm and added it to the list.htm where I needed it to be.

if @TABLE.arrMasterTables.len##

{BEGIN mastertable_block}

<div id="mastertable_block{$id}">

<div align="center">{$showmasterfile}</div>

<div align=center><input type=button class="button" value="##message BACK_TO_MASTER##" {$backtomasterlink_attrs}></div>

</div>

{END mastertable_block}

endif##


If anyone can tell me why this does not work I would greatly appreciate it.
Cheers, Nick
Group:Members

Posts:70

Joined:15-November 07

Posted 29 January 2010 - 04:30 PM

ok my bad, I found a solution while tinkering.
in the ../PhpRunner/Source/list.php I found the following line and just edited it accordingly.
//original code//$xt->assign("backtomasterlink_attrs","href=\"##@BUILDER.Tables[strDataSourceTable==@m.strMasterTable].strShortTableName##_list.##@ext##?a=return\"");
$xt->assign("backtomasterlink_attrs","href=\"##@BUILDER.Tables[strDataSourceTable==@m.strMasterTable].strShortTableName h##_list.##@ext##\" onclick=\"window.location.href='##@BUILDER.Tables[strDataSourceTable==@m.strMasterTable].strShortTableName h##_list.##@ext##?a=return'\"");
Thanks
Nick

J
Jane 6/1/2010

Nick,
Here is the correct code:

$xt->assign("backtomasterlink_attrs"," onclick=\"window.location.href='##@BUILDER.Tables[strDataSourceTable==@m.strMasterTable].strShortTableName h##_list.##@ext##?a=return'\" ");