/**
     * Get fieldset block
     * @return string
     */
    private function getFieldsetBlock()
    {
        $String = '';
        $String .= HTML::info(sprintf(__('Found %s activities.'), count($this->TrainingObjects)));
        $String .= '<table class="fullwidth multi-import-table zebra-style c" id="multi-import-table">';
        $String .= '<thead><tr><th>' . __('Import') . '</th><th>' . __('Date') . '</th><th>' . __('Duration') . '</th><th>' . __('Distance') . '</th><th colspan="4"></th></tr></thead>';
        $String .= '<tbody>';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $String .= '<tr>' . $this->getTableRowFor($TrainingObject, $i) . '</tr>';
        }
        $String .= '</tbody>';
        $String .= '</table>';
        $String .= Ajax::wrapJSforDocumentReady('
			$("#multi-import-table td").click(function(e){
				if ($(e.target).closest(\'input[type="checkbox"]\').length == 0)
					$(this).parent().find(\'input:checkbox\').attr(\'checked\', !$(this).parent().find(\'input:checkbox\').attr(\'checked\'));
			});
		');
        return $String;
    }
 /**
  * Connect pagination links
  */
 protected function connectPagination()
 {
     echo Ajax::wrapJSforDocumentReady('$("#search-back").click(function(){' . 'var $i = $("#search input[name=\'page\']");' . '$i.val( parseInt($i.val()) - 1 );' . '$("#search").submit();' . '});' . '$("#search-next").click(function(){' . 'var $i = $("#search input[name=\'page\']");' . '$i.val( parseInt($i.val()) + 1 );' . '$("#search").submit();' . '});');
 }
 /**
  * @return string
  */
 protected function getJScode()
 {
     return Ajax::wrapJSforDocumentReady('splits = $("#formularSplitsContainer");' . 'defaultSplit = $("#defaultInputSplit").val();' . 'splits.find(".add-split").click(addSplit);' . 'splits.find(".round-splits").click(roundSplits);' . 'splits.find(".sum-splits").click(sumSplitsToTotal);' . 'splits.find(".active-splits").click(allSplitsActive);' . 'splits.find(".rest-splits").click(allSplitsRest);' . 'splits.find(".alternate-splits-rest").click(function(){evenSplits(0);oddSplits(1);});' . 'splits.find(".alternate-splits-active").click(function(){evenSplits(1);oddSplits(0);});');
 }
 /**
  * Init plots
  */
 protected function initPlots()
 {
     echo Ajax::wrapJSforDocumentReady('RunalyzePlot.resizeTrainingCharts();');
 }
<?php

/**
 * File for displaying the config-window for a plugin.
 * Call:   call.Plugin.config.php?id=
 */
require_once '../inc/class.Frontend.php';
$Frontend = new Frontend(true);
$Factory = new PluginFactory();
if (isset($_GET['key'])) {
    $Factory->uninstallPlugin(filter_input(INPUT_GET, 'key'));
    echo Ajax::wrapJSforDocumentReady('Runalyze.Overlay.load("call/window.config.php");');
} elseif (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $Plugin = $Factory->newInstanceFor($_GET['id']);
    $Plugin->displayConfigWindow();
} else {
    echo '<em>' . __('Something went wrong ...') . '</em>';
}
Exemple #6
0
 /**
  * Send all errors to JS-Log 
  */
 private function sendErrorsToJSLog()
 {
     echo Ajax::wrapJSforDocumentReady('Runalyze.Log.addArray(' . json_encode($this->errors) . ')');
 }
?>

</head>

<body id="installer">

<div id="headline">
	<a class="tab logo" href="http://www.runalyze.de/" target="_blank">Runalyze</a>
	<a class="tab right" href="login.php"><i class="fa fa-fw fa-sign-in"></i> <?php 
_e('Please login');
?>
</a>
</div>

<?php 
echo Ajax::wrapJSforDocumentReady('Runalyze.init();');
?>

<div id="overlay" style="display:block;"></div>

<div id="ajax-outer">
<div id="ajax" class="panel<?php 
if (defined('ADMIN_WINDOW')) {
    echo ' big-window';
}
?>
" style="display:block;">
	<div class="panel-heading">
		<div class="panel-menu">
                    <ul>
                    <li class="with-submenu">
$NumKm = Cache::get('NumKm', 1);
if ($NumKm == NULL) {
    $NumKm = DB::getInstance()->query('SELECT SUM(distance) FROM ' . PREFIX . 'training')->fetchColumn();
    Cache::set('NumKm', $NumKm, '500', 1);
}
DB::getInstance()->startAddingAccountID();
$NumUserOn = SessionAccountHandler::getNumberOfUserOnline();
?>

<p class="text"></p>
<p class="text small c login-window-stats">
	<?php 
printf(_n('Until now <strong>%d</strong> athlete is registered and', 'Until now <strong>%d</strong> athletes are registered and', $NumUser), $NumUser);
?>
	<?php 
printf(_n('has logged <strong>%s</strong>.', 'have logged <strong>%s</strong>.', $NumUser), Distance::format($NumKm));
?>
	<br>
	<?php 
printf(_n('<strong>%d</strong> athlete is online.', '<strong>%d</strong> athletes are online.', $NumUserOn), $NumUserOn);
?>
<br>
</p>

<?php 
if (isset($_POST['new_username'])) {
    echo Ajax::wrapJSforDocumentReady("show('reg');");
}
if (isset($_POST['send_username'])) {
    echo Ajax::wrapJSforDocumentReady("show('pwf');");
}
    /**
     * Get fieldset block
     * @return string
     */
    private function getFieldsetBlock()
    {
        $String = '';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $activityIDs[] = $TrainingObject->getActivityId();
        }
        $duplicates = (new DuplicateFinder(DB::getInstance(), SessionAccountHandler::getId()))->checkForDuplicates($activityIDs);
        $countDuplicates = count(array_filter($duplicates));
        $String .= HTML::info(sprintf(__('Found %s activities.'), count($this->TrainingObjects)));
        if ($countDuplicates > 0) {
            $String .= HTML::warning(_n('Found <strong>one</strong> duplicate activity.', 'Found duplicate activities.', $countDuplicates));
        }
        $String .= '<table class="fullwidth multi-import-table zebra-style c" id="multi-import-table">';
        $String .= '<thead><tr><th>' . __('Import') . '</th><th>' . __('Date') . '</th><th>' . __('Duration') . '</th><th>' . __('Distance') . '</th><th colspan="4"></th></tr></thead>';
        $String .= '<tbody>';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $String .= '<tr>' . $this->getTableRowFor($TrainingObject, $i, $duplicates[$TrainingObject->getActivityId()]) . '</tr>';
        }
        $String .= '</tbody>';
        $String .= '</table>';
        $String .= Ajax::wrapJSforDocumentReady('
			$("#multi-import-table td").click(function(e){
				if ($(e.target).closest(\'input[type="checkbox"]\').length == 0)
					$(this).parent().find(\'input:checkbox\').attr(\'checked\', !$(this).parent().find(\'input:checkbox\').attr(\'checked\'));
			});
		');
        return $String;
    }
Exemple #10
0
<p class="info">
	<?php 
_e('<strong>VDOT/Time (Shape):</strong> by your shape at that time<br>');
?>
	<?php 
_e('The time is the prognosis by Runalyze.');
?>
</p>

<p class="info">
	<?php 
_e('<strong>Corrector:</strong> Ratio between VDOT and VDOT (by HR)');
?>
</p>

<?php 
if (Configuration::Vdot()->useElevationCorrection()) {
    ?>
<p class="warning">
	<?php 
    _e('The distance correction for elevation is not used in this table.');
    ?>
</p>
<?php 
}
?>

<?php 
echo Ajax::wrapJSforDocumentReady('$("#ajax").addClass("big-window");');
Exemple #11
0
<?php

/**
 * File displaying the config panel
 * Call:   call/window.config.php[?key=...]
 */
require '../inc/class.Frontend.php';
$Frontend = new Frontend();
$ConfigTabs = new ConfigTabs();
$ConfigTabs->addDefaultTab(new ConfigTabGeneral());
$ConfigTabs->addTab(new ConfigTabPlugins());
$ConfigTabs->addTab(new ConfigTabDataset());
$ConfigTabs->addTab(new ConfigTabSports());
$ConfigTabs->addTab(new ConfigTabTypes());
$ConfigTabs->addTab(new ConfigTabEquipment());
$ConfigTabs->addTab(new ConfigTabAccount());
$ConfigTabs->display();
echo Ajax::wrapJSforDocumentReady('Runalyze.Overlay.removeClasses();');