/**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->clientOptions['single'] = true;
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     $this->clientOptions['single'] = true;
     return parent::run();
 }
Esempio n. 3
0
$f->add(new TrFormElement(_T('Interval between two full backups (days)', 'backuppc'), new InputTpl('full')), array("value" => $profile['full'] == '' ? '' : floatval($profile['full']) + 0.03, "required" => True));
// INCR period
$f->add(new TrFormElement(_T('Interval between two incr backups (days)', 'backuppc'), new InputTpl('incr')), array("value" => $profile['incr'] == '' ? '' : floatval($profile['incr']) + 0.03, "required" => True));
$daynames = array(_T('Monday', 'backuppc'), _T('Tuesday', 'backuppc'), _T('Wednesday', 'backuppc'), _T('Thursday', 'backuppc'), _T('Friday', 'backuppc'), _T('Saturday', 'backuppc'), _T('Sunday', 'backuppc'));
// Exclude periods
$exclude_periods = explode("\n", $profile['exclude_periods']);
$z = 0;
foreach ($exclude_periods as $period) {
    preg_match("\$([0-9.]+)=>([0-9.]+):([^:]+)\$", $period, $matches);
    if (count($matches) != 4) {
        continue;
    }
    list($period, $from, $to, $days) = $matches;
    $days = explode(',', $days);
    // DAYS SELECT
    $sel = new MultipleSelect('days' . $z++);
    $sel->setElements($daynames);
    $sel->setElementsVal(array('1', '2', '3', '4', '5', '6', '7'));
    foreach ($days as $day) {
        $sel->setSelected(trim($day));
    }
    // Start hour
    $fields = array(new hourInputTpl('starthour[]'), new textTpl(_T('to', 'backuppc')), new hourInputTpl('endhour[]'), new textTpl(_T('on', 'backuppc')), $sel, new buttonTpl('removePeriod', _T('Remove', 'backuppc'), 'removePeriod'));
    $values = array(float2hhmm($from), '', float2hhmm($to), '', '');
    $f->add(new TrFormElement(_T('Do not backup from', 'backuppc'), new multifieldTpl($fields)), array("value" => $values, "required" => True));
}
// Add Period button
$addPeriodBtn = new buttonTpl('addPeriod', _T('Add exclusion', 'backuppc'));
$addPeriodBtn->setClass('btnPrimary');
$f->add(new TrFormElement('', $addPeriodBtn), array());
// If BackupProfile id is transmitten, we write it in the form