21300 Posts in 5735 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 329 Views |
-
php code into silverstripe

14 December 2012 at 9:54am
Hello,
how can I add extern php code into silverstripe admin?
I have eight pages that are written using PHP. Now I want to put the pages in the admin section of SilverStripe. Pages will be a part of Silverstripe.
Is that possible?
Thanks
-
Re: php code into silverstripe

19 December 2012 at 4:23pm Last edited: 19 December 2012 4:25pm
There is no way to add PHP into the admin panel directly from a users perspective, you will have to convert the PHP scripts into page types yourself, as per SilverStripe documentation.
What sort of scripts are they?
Sean
-
Re: php code into silverstripe

20 December 2012 at 12:50am
If you use an ModelAdmin for your DataObject, you can replace it with the RemodelAdmin.
With this module, you can include in the ModelAdminPanel buttons witch call an php-file:In remodeladmin/templates/Includes/RemodelAdmin_right.ss:
<div class="controlbuttons">
<button id="btn1">Do something</button>
</div>In remodeladmin/javascript/remodeladmin.js:
$('#btn1').click(function(){ $.post("remodeladmin/php/dosomething.php", { id: $(this).val(), status: "status1" }); });In remodeladmin/php/dosomething.php you can catch the id and the status:
$id = $_POST['id'];
$status = $_POST['status'];
function dosomething(){ do it }Hope it helps.
-
Re: php code into silverstripe

23 December 2012 at 9:32am
Hello Sean,
thank you for your answer. That's not a script, there are only php codes, they are wirtting by hands. You could see this in attach!
How can I convert this in page types?
Thanks again for your help!
Samal
| 329 Views | ||
|
Page:
1
|
Go to Top |



