Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Encore\Admin\Widgets; use Illuminate\Contracts\Support\Renderable; clas..
Decoded Output download
<?php
namespace Encore\Admin\Widgets;
use Illuminate\Contracts\Support\Renderable;
class Box extends Widget implements Renderable
{
/**
* @var string
*/
protected $view = 'admin::widgets.box';
/**
* @var string
*/
protected $title = '';
/**
* @var string
*/
protected $content = 'here is the box content.';
/**
* @var string
*/
protected $footer = '';
/**
* @var array
*/
protected $tools = [];
/**
* @var string
*/
protected $script;
/**
* Box constructor.
*
* @param string $title
* @param string $content
*/
public function __construct($title = '', $content = '', $footer = '')
{
if ($title) {
$this->title($title);
}
if ($content) {
$this->content($content);
}
if ($footer) {
$this->footer($footer);
}
$this->class('box');
}
/**
* Set box content.
*
* @param string|Renderable $content
*
* @return $this
*/
public function content($content)
{
if ($content instanceof Renderable) {
$this->content = $content->render();
} else {
$this->content = (string) $content;
}
return $this;
}
/**
* Set box footer.
*
* @param string|Renderable $footer
*
* @return $this
*/
public function footer($footer)
{
if ($footer instanceof Renderable) {
$this->footer = $footer->render();
} else {
$this->footer = (string) $footer;
}
return $this;
}
/**
* Set box title.
*
* @param string $title
*
* @return $this
*/
public function title($title)
{
$this->title = $title;
return $this;
}
/**
* Set box as collapsable.
*
* @return $this
*/
public function collapsable()
{
$this->tools[] =
'<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>';
return $this;
}
/**
* Set box body scrollable.
*
* @param array $options
*
* @return $this
*/
public function scrollable($options = [], $nodeSelector = '')
{
$this->id = uniqid('box-slim-scroll-');
$scrollOptions = json_encode($options);
$nodeSelector = $nodeSelector ?: '.box-body';
$this->script = <<<SCRIPT
$("#{$this->id} {$nodeSelector}").slimScroll({$scrollOptions});
SCRIPT;
return $this;
}
/**
* Set box as removable.
*
* @return $this
*/
public function removable()
{
$this->tools[] =
'<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>';
return $this;
}
/**
* Set box style.
*
* @param string $styles
*
* @return $this|Box
*/
public function style($styles)
{
if (is_string($styles)) {
return $this->style([$styles]);
}
$styles = array_map(function ($style) {
return 'box-'.$style;
}, $styles);
$this->class = $this->class.' '.implode(' ', $styles);
return $this;
}
/**
* Add `box-solid` class to box.
*
* @return $this
*/
public function solid()
{
return $this->style('solid');
}
/**
* Variables in view.
*
* @return array
*/
protected function variables()
{
return [
'title' => $this->title,
'content' => $this->content,
'footer' => $this->footer,
'tools' => $this->tools,
'attributes' => $this->formatAttributes(),
'script' => $this->script,
];
}
/**
* Render box.
*
* @return string
*/
public function render()
{
return view($this->view, $this->variables())->render();
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Encore\Admin\Widgets;
use Illuminate\Contracts\Support\Renderable;
class Box extends Widget implements Renderable
{
/**
* @var string
*/
protected $view = 'admin::widgets.box';
/**
* @var string
*/
protected $title = '';
/**
* @var string
*/
protected $content = 'here is the box content.';
/**
* @var string
*/
protected $footer = '';
/**
* @var array
*/
protected $tools = [];
/**
* @var string
*/
protected $script;
/**
* Box constructor.
*
* @param string $title
* @param string $content
*/
public function __construct($title = '', $content = '', $footer = '')
{
if ($title) {
$this->title($title);
}
if ($content) {
$this->content($content);
}
if ($footer) {
$this->footer($footer);
}
$this->class('box');
}
/**
* Set box content.
*
* @param string|Renderable $content
*
* @return $this
*/
public function content($content)
{
if ($content instanceof Renderable) {
$this->content = $content->render();
} else {
$this->content = (string) $content;
}
return $this;
}
/**
* Set box footer.
*
* @param string|Renderable $footer
*
* @return $this
*/
public function footer($footer)
{
if ($footer instanceof Renderable) {
$this->footer = $footer->render();
} else {
$this->footer = (string) $footer;
}
return $this;
}
/**
* Set box title.
*
* @param string $title
*
* @return $this
*/
public function title($title)
{
$this->title = $title;
return $this;
}
/**
* Set box as collapsable.
*
* @return $this
*/
public function collapsable()
{
$this->tools[] =
'<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>';
return $this;
}
/**
* Set box body scrollable.
*
* @param array $options
*
* @return $this
*/
public function scrollable($options = [], $nodeSelector = '')
{
$this->id = uniqid('box-slim-scroll-');
$scrollOptions = json_encode($options);
$nodeSelector = $nodeSelector ?: '.box-body';
$this->script = <<<SCRIPT
$("#{$this->id} {$nodeSelector}").slimScroll({$scrollOptions});
SCRIPT;
return $this;
}
/**
* Set box as removable.
*
* @return $this
*/
public function removable()
{
$this->tools[] =
'<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>';
return $this;
}
/**
* Set box style.
*
* @param string $styles
*
* @return $this|Box
*/
public function style($styles)
{
if (is_string($styles)) {
return $this->style([$styles]);
}
$styles = array_map(function ($style) {
return 'box-'.$style;
}, $styles);
$this->class = $this->class.' '.implode(' ', $styles);
return $this;
}
/**
* Add `box-solid` class to box.
*
* @return $this
*/
public function solid()
{
return $this->style('solid');
}
/**
* Variables in view.
*
* @return array
*/
protected function variables()
{
return [
'title' => $this->title,
'content' => $this->content,
'footer' => $this->footer,
'tools' => $this->tools,
'attributes' => $this->formatAttributes(),
'script' => $this->script,
];
}
/**
* Render box.
*
* @return string
*/
public function render()
{
return view($this->view, $this->variables())->render();
}
}
Function Calls
None |
Stats
MD5 | d76683152381b21961d44b6f6f8d3f8e |
Eval Count | 0 |
Decode Time | 87 ms |