3 * Bacula® - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2014 Marcin Haba
8 * The main author of Baculum is Marcin Haba.
9 * The main author of Bacula is Kern Sibbald, with contributions from many
10 * others, a complete list can be found in the file AUTHORS.
12 * You may use this file and others of this release according to the
13 * license defined in the LICENSE file, which includes the Affero General
14 * Public License, v3.0 ("AGPLv3") and some additional permissions and
15 * terms pursuant to its AGPLv3 Section 7.
17 * Bacula® is a registered trademark of Kern Sibbald.
20 Prado::using('System.Web.UI.ActiveControls.TActivePanel');
21 Prado::using('System.Web.UI.ActiveControls.TActiveButton');
22 Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
23 Prado::using('Application.Portlets.Portlets');
25 class Console extends Portlets {
27 const MAX_CONSOLE_OUTPUT_BATCH = -1000;
29 public function sendCommand($sender, $param) {
30 $cmd = trim($this->CommandLine->Text);
32 $command = explode(' ', $cmd);
33 $out = $this->Application->getModule('api')->set(array('console'), $command)->output;
35 $out = array_slice($out, self::MAX_CONSOLE_OUTPUT_BATCH);
36 $output = $this->OutputListing->Text . PHP_EOL . implode(PHP_EOL, $out);
38 $output = $this->OutputListing->Text . PHP_EOL . $out;
40 $this->OutputListing->Text = $output;
41 $this->CommandLine->Text = '';
45 public function clearConsole($sender, $param) {
46 $this->OutputListing->Text = '';
47 $this->CommandLine->Text = '';