Esempio n. 1
0
 /**
  * Init DatabaseScheme 
  */
 protected function initDatabaseScheme()
 {
     $this->DatabaseScheme = DatabaseSchemePool::get('training/schemes/scheme.UserData.php');
     $Factory = new PluginFactory();
     if ($Factory->isInstalled('RunalyzePluginPanel_Sportler')) {
         $Plugin = $Factory->newInstance('RunalyzePluginPanel_Sportler');
         if (!$Plugin->Configuration()->value('use_body_fat')) {
             $this->DatabaseScheme->hideFieldset('analyse');
         }
         if (!$Plugin->Configuration()->value('use_pulse')) {
             $this->DatabaseScheme->hideField('pulse_rest');
         }
     }
 }
 /**
  * Add tab for comparison of years
  */
 protected function addTabForComparisonOfYears()
 {
     $Content = '';
     $Factory = new PluginFactory();
     if ($Factory->isInstalled('RunalyzePluginStat_Statistiken')) {
         $Plugin = $Factory->newInstance('RunalyzePluginStat_Statistiken');
         $Content .= $Plugin->getYearComparisonTable();
     }
     if ($Factory->isInstalled('RunalyzePluginStat_Wettkampf')) {
         if ($Content != '') {
             $Content .= '<tbody><tr class="no-zebra no-border"><td colspan="' . (date("Y") - START_YEAR + 2) . '">&nbsp;</td></tr></tbody>';
         }
         $Plugin = $Factory->newInstance('RunalyzePluginStat_Wettkampf');
         $Content .= $Plugin->getYearComparisonTable();
     }
     if ($Content != '') {
         $this->StatisticTabs->addTab(__('Year on year') . ' (' . __('Running') . ')', 'statistics-years', $Content);
     }
 }
Esempio n. 3
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Data = AccountHandler::getDataForId(SessionAccountHandler::getId());
     FormularInput::setStandardSize(FormularInput::$SIZE_MIDDLE);
     $UsernameField = new FormularInput('name', __('Username'), $Data['username']);
     $UsernameField->setDisabled();
     $MailField = new FormularInput('name', __('Email address'), $Data['mail']);
     $MailField->setDisabled();
     $NameField = new FormularInput('name', __('Name'), $Data['name']);
     $LanguageField = new FormularSelectBox('language', __('Language'), $Data['language']);
     foreach (Language::availableLanguages() as $klang => $lang) {
         $LanguageField->addOption($klang, $lang[0]);
     }
     $SinceField = new FormularInput('name', __('Registered since'), date('d.m.Y H:i', $Data['registerdate']));
     $SinceField->setDisabled();
     $LastLoginField = new FormularInput('name', __('Last Login'), date('d.m.Y H:i', $Data['lastlogin']));
     $LastLoginField->setDisabled();
     $Account = new FormularFieldset(__('Your account'));
     $Account->addField($UsernameField);
     $Account->addField($MailField);
     $Account->addField($NameField);
     $Account->addField($LanguageField);
     $Account->addField($SinceField);
     $Account->addField($LastLoginField);
     $AllowMailsField = new FormularSelectBox('allow_mails', __('Email me'), $Data['allow_mails']);
     $AllowMailsField->addOption('1', __('Yes'));
     $AllowMailsField->addOption('0', __('No'));
     $Notifications = new FormularFieldset(__('Notifications'));
     $Notifications->addInfo(__('At irregular intervals we are sending mails to you. We will never send you spam or advertisement.'));
     $Notifications->addField($AllowMailsField);
     $Password = new FormularFieldset(__('Change your password'));
     if (empty($_POST['old_pw']) && empty($_POST['new_pw']) && empty($_POST['new_pw_repeat'])) {
         $Password->setCollapsed();
     } else {
         // Don't show passwords as 'value="..."'
         $_POST['old_pw'] = '';
         $_POST['new_pw'] = '';
         $_POST['new_pw_repeat'] = '';
     }
     $Password->addField(new FormularInputPassword('old_pw', __('Old password')));
     $Password->addField(new FormularInputPassword('new_pw', __('New password')));
     $Password->addField(new FormularInputPassword('new_pw_repeat', __('Repeat new password')));
     $Backup = new FormularFieldset(__('Backup your data'));
     $Backup->setCollapsed();
     $Factory = new PluginFactory();
     if ($Factory->isInstalled('RunalyzePluginTool_DbBackup')) {
         $Plugin = $Factory->newInstance('RunalyzePluginTool_DbBackup');
         $Backup->addInfo(__('Please use the plugin') . ' \'<strong>' . $Plugin->getWindowLink() . '</strong>\'.');
     } else {
         $Backup->addInfo(__('The backup of all your data is not manually possible yet.<br>' . 'In important individual cases write us an e-mail to mail@runalyze.de and and we will take care of it right away!'));
     }
     $DeleteLink = Ajax::window('<a href="call/window.delete.php"><strong>' . __('Delete your account') . ' &raquo;</strong></a>') . '<br><br>' . __('You\'ll receive an email with a link to confirm the deletion.<br>' . 'The deletion is permanent and cannot be reversed. ' . 'Therefore, you should backup your data.');
     $Delete = new FormularFieldset(__('Delete your account'));
     $Delete->setCollapsed();
     $Delete->addWarning($DeleteLink);
     $this->Formular->addFieldset($Account);
     $this->Formular->addFieldset($Notifications);
     $this->Formular->addFieldset($Password);
     $this->Formular->addFieldset($Backup);
     $this->Formular->addFieldset($Delete);
     $this->Formular->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W100);
 }