示例#1
0
 /**
  * Display formular
  */
 private function displayFormular()
 {
     $this->Formular = new Formular($this->getUrl() . '&form=true');
     $this->setFieldsetsAndFields();
     $this->Formular->setId($this->key);
     $this->Formular->addCSSclass('ajax');
     $this->Formular->addCSSclass('no-automatic-reload');
     $this->Formular->addHiddenValue('configTabKey', $this->key);
     $this->Formular->addSubmitButton(__('Save'));
     $this->Formular->display();
 }
 /**
  * Init formular
  */
 protected function initFormular()
 {
     $this->Formular = new Formular();
     $this->Formular->setId('prognosis-calculator');
     $this->Formular->addCSSclass('ajax');
     $this->Formular->addCSSclass('no-automatic-reload');
     $this->Formular->addFieldset($this->FieldsetInput);
     $this->Formular->addFieldset($this->FieldsetResult);
     $this->Formular->addSubmitButton(__('Show prognosis'));
 }
 /**
  * Display the content
  * @see PluginPanel::displayContent()
  */
 protected function displayContent()
 {
     if (isset($_GET['delete'])) {
         System::clearCache();
     }
     $Fieldset = new FormularFieldset(__('Empty your cache'));
     $Fieldset->addInfo(self::getActionLink('<strong>' . __('Empty your cache') . '</strong>', 'delete=true'));
     $Formular = new Formular();
     $Formular->setId('cacheclean-form');
     $Formular->addFieldset($Fieldset);
     $Formular->display();
 }
示例#4
0
 /**
  * Display files
  */
 private function displayFiles()
 {
     $Formular = new Formular();
     $Formular->setId('admin-files');
     $Formular->addHiddenValue('hash-files', $this->getAdminHash());
     $Formular->addFieldset($this->getFilesFieldset());
     $Formular->display();
 }
 /**
  * Display list with files 
  */
 protected function displayList()
 {
     $ListOfFiles = $this->getExistingFiles();
     $Fieldset = new FormularFieldset(__('Export data'));
     if (empty($ListOfFiles)) {
         $Fieldset->addFileBlock('<em>You did not export anything.</em>');
     } else {
         foreach ($ListOfFiles as $File) {
             $String = '';
             $FileNameParts = explode('-', $File);
             $Year = isset($FileNameParts[3]) ? $FileNameParts[3] : '';
             if (strlen($Year) == 8) {
                 $String .= '<strong>' . substr($Year, 6, 2) . '.' . substr($Year, 4, 2) . '.' . substr($Year, 0, 4) . ':</strong> ';
             }
             $String .= $File;
             $String .= ', ' . Filesystem::getFilesize(FRONTEND_PATH . $this->BackupPath . $File);
             $Fieldset->addFileBlock('<a href="inc/' . $this->BackupPath . $File . '" target="_blank">' . $String . '</a>');
         }
     }
     if ($this->importIsOnProgress) {
         $Fieldset->setCollapsed();
     }
     $Formular = new Formular();
     $Formular->setId('backup-list');
     $Formular->addFieldset($Fieldset);
     $Formular->display();
 }
示例#6
0
/**
 * Window: explanations for calculations
 * @package Runalyze\Plugins\Panels
 */
require '../../inc/class.Frontend.php';
$Frontend = new Frontend();
?>
<div class="panel-heading">
	<h1><?php 
_e('Explanation: How are these experimental values calculated?');
?>
</h1>
</div>

<div class="panel-content">
<?php 
$Factory = new PluginFactory();
$Plugin = $Factory->newInstance('RunalyzePluginPanel_Rechenspiele');
$Formular = new Formular();
$Formular->setId('rechenspiele-calculator');
$Formular->addCSSclass('ajax');
$Formular->addCSSclass('no-automatic-reload');
$Formular->addFieldset($Plugin->getFieldsetTRIMP(), false);
$Formular->addFieldset($Plugin->getFieldsetVDOT(), false);
$Formular->addFieldset($Plugin->getFieldsetBasicEndurance());
$Formular->addFieldset($Plugin->getFieldsetPaces(), false);
$Formular->allowOnlyOneOpenedFieldset();
$Formular->display();
?>
</div>
示例#7
0
 /**
  * Display exported files
  */
 protected function displayExportedFiles()
 {
     $ListOfFiles = $this->getExistingFiles();
     $Fieldset = new FormularFieldset(sprintf(__('Up to now you have exported <strong>%d</strong> trainings.'), count($ListOfFiles)));
     if (strlen(Request::param('delete')) > 0) {
         $index = (int) Request::param('delete');
         if (!isset($ListOfFiles[$index - 1])) {
             $Fieldset->addWarning('Don\' do that!');
         } else {
             $Fieldset->addInfo(__('The file has been removed.'));
             Filesystem::deleteFile('export/files/' . $ListOfFiles[$index - 1]);
             unset($ListOfFiles[$index - 1]);
         }
     } else {
         $Fieldset->setCollapsed();
     }
     if (empty($ListOfFiles)) {
         $Fieldset->addFileBlock('<em>' . __('You did not export any training.') . '</em>');
     } else {
         foreach ($ListOfFiles as $i => $File) {
             $String = $File . ', ' . Filesystem::getFilesize(FRONTEND_PATH . 'export/files/' . $File);
             $Link = '<a href="inc/export/files/' . $File . '" target="_blank">' . $String . '</a>';
             $Delete = Ajax::window('<a class="right small" href="' . self::$URL . '?id=' . $this->TrainingID . '&delete=' . ($i + 1) . '">[' . __('delete') . ']</a>', 'small');
             $Fieldset->addFileBlock($Delete . $Link);
         }
     }
     $Formular = new Formular();
     $Formular->setId('export-list');
     $Formular->addFieldset($Fieldset);
     $Formular->display();
 }
<div class="w50" id="login-window">
<?php 
FormularInput::setStandardSize(FormularInput::$SIZE_MIDDLE);
$Fieldset = new FormularFieldset(__('Administration'));
$Fieldset->addField(new FormularInput('user', __('Account'), 'admin'));
$Fieldset->addField(new FormularInputPassword('password', __('Password')));
$Fieldset->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W100);
$Formular = new Formular();
$Formular->setId('admin-login');
$Formular->addFieldset($Fieldset);
$Formular->addSubmitButton(__('Login'));
$Formular->setSubmitButtonsCentered();
$Formular->display();
?>
</div>