devsuite/cds/components/Crispage/DevSuite/ConsoleComponent.php

40 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2024-05-27 00:44:14 -04:00
<?php
namespace Crispage\DevSuite;
defined("ROOT") or die();
use \Crispage\Auth\CorePermissions;
class ConsoleComponent extends \Crispage\Framework\Component {
public static function getExtensionInfo(): array {
return [
"id" => "crispage.devsuite.components.console",
"version" => VERSION,
"package" => "crispage.devsuite",
"cache_policy" => \Crispage\Caching\CacheEngine::POL_NOCACHE
];
}
public function __construct(\Crispage $app, array $data) {
parent::__construct($app, $data);
}
public function render(): void {
?>
<form method="post" action="<?php echo WROOT; ?>/backend" class="cds_form">
<h1><?php ($this->app->i18n)("{%CDS_CONSOLE}"); ?></h1>
<input type="hidden" name="route" value="cds_console" />
<label for="script"><?php ($this->app->i18n)("{%SCRIPT}:"); ?></label>
<textarea name="script" required rows="22" cols="80" ><?php echo $this->data["script"] ?? ""; ?></textarea>
<br />
<input type="submit" value="<?php ($this->app->i18n)("{%RUN}"); ?>" />
<hr />
<p><?php ($this->app->i18n)("{%OUTPUT}:"); ?></p>
<pre class="output"><?php echo $this->data["output"] ?? ""; ?></pre>
</form>
<?php
}
}
?>