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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
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
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.
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