コード例 #1
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Dataset = new FormularFieldset(__('Your Dataset'));
     $Dataset->setHtmlCode($this->getCode());
     $Dataset->addInfo(__('You can specify which values show up in the overview of your activities.') . '<br>' . __('This does not influence the detailed activity view, the form or any plugin.'));
     $this->Formular->addFieldset($Dataset);
 }
コード例 #2
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Sports = new FormularFieldset(__('Your sports'));
     $Sports->setHtmlCode($this->getCode() . $this->getInfoFieldsAfterCode());
     $Sports->addInfo(__('Hover over the headings if the abbreviations are unclear.'));
     $this->Formular->addFieldset($Sports);
 }
コード例 #3
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Types = new FormularFieldset(__('Activity types'));
     $Types->setHtmlCode($this->getCode());
     $Types->addInfo(__('Activity types are useful to seperate your training into different categories. ' . 'An activity type can only belong to one sport.'));
     $Types->addInfo(__('Finding your personal bests requires one type (for running) to be set as the \'Race\'-type.'));
     $this->Formular->addFieldset($Types);
 }
コード例 #4
0
 /**
  * Init for given objects
  */
 protected function initForObjects()
 {
     $Fieldset = new FormularFieldset(__('Choose activities'));
     $Fieldset->addBlock($this->getFieldsetBlock());
     $Fieldset->setHtmlCode($this->getConfigCode());
     $this->addFieldset($Fieldset);
     $this->addSubmitButton(__('Import selected activities'));
     $this->addHiddenValue('number-of-trainings', count($this->TrainingObjects));
 }
コード例 #5
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Clothes = new FormularFieldset(__('Your equipment'));
     $Clothes->setHtmlCode($this->getCode());
     $Clothes->addInfo(__('Equipment can be entered for additional statistics.<br>' . 'Category and abbreviation are used to order and display them in the form for editing an activity.'));
     $Clothes->addInfo(__('The category should be a number.'));
     $Clothes->addInfo(__('Just fill out the last row to add a new equipment.'));
     $this->Formular->addFieldset($Clothes);
 }
コード例 #6
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $EquipmentType = new FormularFieldset(__('Your equipment categories'));
     $EquipmentType->setHtmlCode($this->getEquipmentTypeCode());
     $EquipmentType->addInfo(__('All your equipment is grouped into some categories. ' . 'For each category, you can define whether one or multiple objects of that category can belong to one activity. ' . 'In addition, you can specify to which sports a category belongs.'));
     $Equipment = new FormularFieldset(__('Your equipment'));
     $Equipment->setHtmlCode($this->getEquipmentCode() . $this->getJS());
     $Equipment->addInfo(__('RUNALYZE collects data and calculates statistics for each of your equipment objects. ' . 'To correctly estimate its lifetime you can specify a \'previous distance\' ' . 'which is added to its calculated distance, e.g. if you used your running shoes for 200 km before tracking them. ' . 'In addition, you can specify a start and end date for its usage. ' . 'Objects will be displayed as \'inactive\' as soon as you have entered an end date.'));
     $this->Formular->addFieldset($EquipmentType);
     $this->Formular->addFieldset($Equipment);
 }
コード例 #7
0
 /**
  * Set all fieldsets and fields
  */
 public function setFieldsetsAndFields()
 {
     $Panels = new FormularFieldset(__('Panels'));
     $Panels->addInfo(__('Panels are small statistics always shown on the right side.'));
     $Panels->setHtmlCode($this->getCodeFor(PluginType::PANEL));
     $Panels->setCollapsed();
     $Stats = new FormularFieldset(__('Statistics'));
     $Stats->addInfo(__('Normal statistics are shown below the activitiy log.'));
     $Stats->setHtmlCode($this->getCodeFor(PluginType::STAT));
     $Tools = new FormularFieldset(__('Tools'));
     $Tools->addInfo(__('Complex tools for analyzing or processing the complete database will open in an overlay.'));
     $Tools->setHtmlCode($this->getCodeFor(PluginType::TOOL));
     $Tools->setCollapsed();
     $Install = new FormularFieldset(__('Install a new plugin'));
     $Install->addInfo(__('New plugins can be installed here.'));
     $Install->setHtmlCode($this->getCodeForInstall());
     $Install->setCollapsed();
     $this->Formular->addFieldset($Panels);
     $this->Formular->addFieldset($Stats);
     $this->Formular->addFieldset($Tools);
     $this->Formular->addFieldset($Install);
     $this->Formular->allowOnlyOneOpenedFieldset();
 }
コード例 #8
0
ファイル: class.VDOTinfo.php プロジェクト: n0rthface/Runalyze
    /**
     * Display with corrector
     */
    protected function displayWithElevation()
    {
        if ($this->Context->hasRoute() && ($this->Context->route()->elevationUp() > 0 || $this->Context->route()->elevationDown())) {
            $up = $this->Context->route()->elevationUp();
            $down = $this->Context->route()->elevationDown();
        } else {
            $up = $this->Context->activity()->elevation();
            $down = $up;
        }
        $Modifier = new Elevation\DistanceModifier($this->Context->activity()->distance(), $up, $down, Configuration::Vdot());
        $VDOT = new JD\VDOT(0, new JD\VDOTCorrector(Configuration::Data()->vdotFactor()));
        $VDOT->fromPaceAndHR($Modifier->correctedDistance(), $this->Context->activity()->duration(), $this->Context->activity()->hrAvg() / Configuration::Data()->HRmax());
        $Fieldset = new FormularFieldset(__('Correction: considering elevation'));
        $Fieldset->setHtmlCode('
			<p class="warning small ' . (Configuration::Vdot()->useElevationCorrection() ? 'hide' : '') . '">
				' . __('This correction method is currently unused.') . '
			</p>

			<div class="w50">
				<label>' . __('Up/Down') . '</label>
				<span class="as-input">+' . $up . '/-' . $down . '&nbsp;m</span>
			</div>
			<div class="w50 double-height-right">
				<label>&rArr; ' . __('VDOT') . '</label>
				<span class="as-input ' . (!Configuration::Vdot()->useElevationCorrection() ? '' : 'highlight') . '">' . $VDOT->value() . '</span>
			</div>
			<div class="w50">
				<label>' . __('Influence') . '</label>
				<span class="as-input">' . sprintf("%+d", 1000 * $Modifier->additionalDistance()) . 'm = ' . Distance::format($Modifier->correctedDistance(), false, 3) . '</span>
			</div>
		');
        $Fieldset->display();
    }
コード例 #9
0
    /**
     * Display elevation correction
     */
    protected function displayElevationCorrection()
    {
        $Fieldset = new FormularFieldset(__('Elevation correction'));
        if ($this->Context->route()->elevationsCorrected()) {
            $Fieldset->addSmallInfo(__('Elevation data have been corrected.'));
        } else {
            $Linker = new Runalyze\View\Activity\Linker($this->Context->activity());
            // TODO: add link to "reload" if correction has been done via ajax
            $Fieldset->setHtmlCode('<p class="warning small block" id="gps-results">
					' . __('Elevation data has not been corrected.') . '<br>
					<br>
					<a class="ajax" target="gps-results" href="' . $Linker->urlToElevationCorrection() . '"><strong>&raquo; ' . __('correct now') . '</strong></a>
				</p>');
        }
        $Fieldset->display();
    }
コード例 #10
0
ファイル: class.ElevationInfo.php プロジェクト: 9x/Runalyze
    /**
     * Display elevation correction
     */
    protected function displayElevationCorrection()
    {
        $Url = (new Runalyze\View\Activity\Linker($this->Context->activity()))->urlToElevationCorrection();
        $Fieldset = new FormularFieldset(__('Elevation correction'));
        $Links = array();
        if ($this->Context->route()->elevationsCorrected()) {
            $textInfo = __('Elevation data has been corrected.') . ($this->Context->route()->elevationsSource() != '' ? ' (' . $this->Context->route()->elevationsSource() . ')' : '');
            $rawLinks = $this->getLinksForCorrectionStrategies();
        } else {
            $textInfo = __('Elevation data has not been corrected.');
            $rawLinks = array('' => __('correct now'));
        }
        foreach ($rawLinks as $urlAppendix => $text) {
            $Links[] = '<a class="ajax" target="gps-results" href="' . $Url . $urlAppendix . '"><strong>&raquo; ' . $text . '</strong></a>';
        }
        $Fieldset->setHtmlCode('<p class="info block" id="gps-results">
				' . $textInfo . '<br><br>
				' . implode('<br>', $Links) . '
			</p>');
        $Fieldset->display();
    }