$Mode = StandardFormular::$SUBMIT_MODE_EDIT; $Shoe = new Shoe(Request::sendId()); } $Formular = new StandardFormular($Shoe, $Mode); if ($Formular->submitSucceeded()) { header('Location: window.schuhe.table.php'); ShoeFactory::clearCache(); exit; } if (Request::sendId() > 0) { $DeleteText = '<strong>' . __('Delete shoe') . ' »</strong>'; $DeleteUrl = $_SERVER['SCRIPT_NAME'] . '?delete=true&id=' . $Shoe->id(); $DeleteLink = Ajax::link($DeleteText, 'ajax', $DeleteUrl); if ($Shoe->getKm() != $Shoe->getAdditionalKm()) { $DeleteLink = __('The shoe cannot be deleted as long it is used for some activity.'); } $DeleteFieldset = new FormularFieldset(__('Delete shoe')); $DeleteFieldset->addWarning($DeleteLink); $Formular->addFieldset($DeleteFieldset); } $Factory = new PluginFactory(); $Plugin = $Factory->newInstance('RunalyzePluginPanel_Schuhe'); echo '<div class="panel-heading">'; echo '<div class="panel-menu"><ul><li>' . $Plugin->tableLink() . '</li></ul></div>'; echo '<h1>' . $Header . '</h1>'; echo '</div>'; echo '<div class="panel-content">'; $Formular->setId('shoe'); $Formular->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W33); $Formular->display(); echo '</div>';
Cache::delete(UserData::CACHE_KEY); header('Location: window.sportler.table.php?reload=true'); exit; } if (Request::sendId() === false) { $Header = __('Add body values'); $Mode = StandardFormular::$SUBMIT_MODE_CREATE; $UserData = new UserData(DataObject::$LAST_OBJECT); $UserData->setCurrentTimestamp(); } else { $Header = __('Edit body values'); $Mode = StandardFormular::$SUBMIT_MODE_EDIT; $UserData = new UserData(Request::sendId()); } $Formular = new StandardFormular($UserData, $Mode); if ($Formular->submitSucceeded()) { header('Location: window.sportler.table.php?reload=true'); exit; } $Factory = new PluginFactory(); $Plugin = $Factory->newInstance('RunalyzePluginPanel_Sportler'); echo '<div class="panel-heading">'; echo '<div class="panel-menu"><ul><li>' . $Plugin->tableLink() . '</li></ul></div>'; echo '<h1>' . $Header . '</h1>'; echo '</div>'; echo '<div class="panel-content">'; $Formular->addCSSclass('no-automatic-reload'); $Formular->setId('sportler'); $Formular->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W33); $Formular->display(); echo '</div>';