本文整理汇总了PHP中Ajax::setReloadFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP Ajax::setReloadFlag方法的具体用法?PHP Ajax::setReloadFlag怎么用?PHP Ajax::setReloadFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ajax
的用法示例。
在下文中一共展示了Ajax::setReloadFlag方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Frontend
/**
* Window: user table
* @package Runalyze\Plugins\Panels
*/
require '../../inc/class.Frontend.php';
use Runalyze\Activity\Duration;
use Runalyze\Activity\Weight;
$Frontend = new Frontend();
$Factory = new PluginFactory();
$Plugin = $Factory->newInstance('RunalyzePluginPanel_Sportler');
$Fields = array('time' => 'date', 'weight' => '', 'sleep_duration' => ' <small>h</small>');
$FieldsPulse = array('pulse_rest' => ' <small>bpm</small>', 'pulse_max' => ' <small>bpm</small>');
$FieldsFat = array('fat' => ' %', 'water' => ' %', 'muscles' => ' %');
$Data = array_reverse(UserData::getFullArray());
if (Request::param('reload') == 'true') {
Ajax::setReloadFlag(Ajax::$RELOAD_ALL);
echo Ajax::getReloadCommand();
}
?>
<div class="panel-heading">
<div class="panel-menu"><ul><li><?php
echo $Plugin->addLink();
?>
</li></ul></div>
<h1><?php
_e('Body values');
?>
</h1>
</div>
<div class="panel-content">
<table id="sportlerTable" class="zebra-style">
示例2: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
$Types = DB::getInstance()->query('SELECT `id` FROM `' . PREFIX . 'type` WHERE `accountid` = ' . SessionAccountHandler::getId())->fetchAll();
$Types[] = array('id' => -1);
foreach ($Types as $Type) {
$id = $Type['id'];
$columns = array('name', 'abbr', 'sportid', 'short', 'hr_avg', 'quality_session');
$values = array($_POST['type']['name'][$id], $_POST['type']['abbr'][$id], $_POST['type']['sportid'][$id], $_POST['type']['short'][$id], $_POST['type']['hr_avg'][$id], isset($_POST['type']['quality_session'][$id]));
if (isset($_POST['type']['delete'][$id])) {
DB::getInstance()->deleteByID('type', (int) $id);
} elseif ($id != -1) {
DB::getInstance()->update('type', $id, $columns, $values);
} elseif (strlen($_POST['type']['name'][$id]) > 2) {
DB::getInstance()->insert('type', $columns, $values);
}
}
if (isset($_POST['type']['name'][$_POST['racetype']]) && !isset($_POST['type']['delete'][$_POST['racetype']]) && $_POST['type']['sportid'][$_POST['racetype']] == Configuration::General()->runningSport() && $_POST['racetype'] != Configuration::General()->competitionType()) {
// TODO: this needs a recalculation of vdot factor
Configuration::General()->updateCompetitionType($_POST['racetype']);
Ajax::setReloadFlag(Ajax::$RELOAD_PLUGINS);
}
TypeFactory::reInitAllTypes();
Ajax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);
}
示例3: handleGetPostRequest
/**
* Handle Get/Post-data and update database
*/
private function handleGetPostRequest()
{
if (isset($_GET['active'])) {
$this->setActive((int) $_GET['active']);
Ajax::setReloadFlag(Ajax::$RELOAD_ALL);
echo Ajax::getReloadCommand();
}
}
示例4: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
$Factory = new PluginFactory();
foreach ($Factory->completeData() as $Plugin) {
$id = $Plugin['id'];
if (isset($_POST['plugin_modus_' . $id]) && isset($_POST['plugin_order_' . $id])) {
DB::getInstance()->update('plugin', $id, array('active', 'order'), array((int) $_POST['plugin_modus_' . $id], (int) $_POST['plugin_order_' . $id]));
}
}
$Factory->clearCache();
Ajax::setReloadFlag(Ajax::$RELOAD_PLUGINS);
}
示例5: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
$Sports = SportFactory::AllSports();
$Sports[] = array('id' => -1);
foreach ($Sports as $Data) {
$id = $Data['id'];
$columns = array('name', 'img', 'short', 'kcal', 'HFavg', 'distances', 'speed', 'power', 'outside', 'main_equipmenttypeid');
$values = array($_POST['sport']['name'][$id], $_POST['sport']['img'][$id], $_POST['sport']['short'][$id], $_POST['sport']['kcal'][$id], $_POST['sport']['HFavg'][$id], isset($_POST['sport']['distances'][$id]), $_POST['sport']['speed'][$id], isset($_POST['sport']['power'][$id]), isset($_POST['sport']['outside'][$id]), $_POST['sport']['main_equipmenttypeid'][$id]);
if (isset($_POST['sport']['delete'][$id]) && $id != Runalyze\Configuration::General()->runningSport()) {
DB::getInstance()->deleteByID('sport', (int) $id);
} elseif ($Data['id'] != -1) {
DB::getInstance()->update('sport', $id, $columns, $values);
} elseif (strlen($_POST['sport']['name'][$id]) > 2) {
Db::getInstance()->insert('sport', $columns, $values);
}
}
SportFactory::reInitAllSports();
Ajax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);
}
示例6: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
$AccountID = SessionAccountHandler::getId();
$UpdateStatement = DB::getInstance()->prepare('UPDATE `' . PREFIX . 'dataset` ' . 'SET `active`=:active, `style`=:style, `position`=:position ' . 'WHERE `accountid`=:accountid AND `keyid`=:keyid');
$InsertStatement = DB::getInstance()->prepare('INSERT INTO `' . PREFIX . 'dataset` ' . '(`keyid`, `active`, `style`, `position`, `accountid`) ' . 'VALUES (:keyid, :active, :style, :position, :accountid)');
foreach (Dataset\Keys::getEnum() as $keyid) {
$active = Dataset\Keys::get($keyid)->mustBeShown() || isset($_POST[$keyid . '_active']) && $_POST[$keyid . '_active'];
$data = array(':active' => $active ? 1 : 0, ':style' => isset($_POST[$keyid . '_style']) ? htmlentities($_POST[$keyid . '_style']) : '', ':position' => isset($_POST[$keyid . '_position']) ? (int) $_POST[$keyid . '_position'] : 99, ':accountid' => $AccountID, ':keyid' => $keyid);
if (!$this->ConfigurationIsNew && $this->Configuration->exists($keyid)) {
$UpdateStatement->execute($data);
} else {
$InsertStatement->execute($data);
}
}
Ajax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);
Cache::delete(Dataset\Configuration::CACHE_KEY);
$this->loadConfiguration();
}
示例7: displayImportFinish
/**
* Display form: import finished
*/
protected function displayImportFinish()
{
require_once __DIR__ . '/class.RunalyzeBulkInsert.php';
require_once __DIR__ . '/class.RunalyzeJsonImporterResults.php';
require_once __DIR__ . '/class.RunalyzeJsonImporter.php';
$fileName = '../data/DbBackup/import/' . $_POST['file'];
$Importer = new RunalyzeJsonImporter($fileName);
$Importer->importData();
Filesystem::deleteFile($fileName);
Ajax::setReloadFlag(Ajax::$RELOAD_ALL);
$Fieldset = new FormularFieldset(__('Import data'));
$Fieldset->addText(__('All data have been imported.'));
$Fieldset->addText(__('It is recommended to use the <em>Database cleanup</em> tool.'));
$Fieldset->addInfo($Importer->resultsAsString());
$Fieldset->addBlock(Ajax::getReloadCommand());
$Formular = new Formular();
$Formular->setId('import-finished');
$Formular->addFieldset($Fieldset);
$Formular->display();
}
示例8: setReloadCommand
/**
* Set reload command
*/
protected function setReloadCommand()
{
Ajax::setPluginIDtoReload($this->Plugin->id());
Ajax::setReloadFlag(Ajax::$RELOAD_PLUGINS);
echo Ajax::getReloadCommand();
}
示例9: Frontend
use Runalyze\View\Activity\Linker;
use Runalyze\Data\Elevation\Correction\NoValidStrategyException;
$Frontend = new Frontend();
$Factory = Context::Factory();
$Activity = $Factory->activity(Request::sendId());
$ActivityOld = clone $Activity;
$Route = $Factory->route($Activity->get(Activity\Object::ROUTEID));
$RouteOld = clone $Route;
try {
$Calculator = new Calculator($Route);
$result = $Calculator->tryToCorrectElevation(Request::param('strategy'));
} catch (NoValidStrategyException $Exception) {
$result = false;
}
if ($result) {
$Calculator->calculateElevation();
$Activity->set(Activity\Object::ELEVATION, $Route->elevation());
$UpdaterRoute = new Route\Updater(DB::getInstance(), $Route, $RouteOld);
$UpdaterRoute->setAccountID(SessionAccountHandler::getId());
$UpdaterRoute->update();
$UpdaterActivity = new Activity\Updater(DB::getInstance(), $Activity, $ActivityOld);
$UpdaterActivity->setAccountID(SessionAccountHandler::getId());
$UpdaterActivity->update();
echo __('Elevation data has been corrected.');
Ajax::setReloadFlag(Ajax::$RELOAD_DATABROWSER_AND_TRAINING);
echo Ajax::getReloadCommand();
echo Ajax::wrapJS('if($("#ajax").is(":visible") && $("#training").length)Runalyze.Overlay.load(\'' . Linker::EDITOR_URL . '?id=' . Request::sendId() . '\')');
echo Ajax::wrapJS('if($("#ajax").is(":visible") && $("#gps-results").length)Runalyze.Overlay.load(\'' . Linker::ELEVATION_INFO_URL . '?id=' . Request::sendId() . '\')');
} else {
echo __('Elevation data could not be retrieved.');
}
示例10: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
if ($_POST['name'] != SessionAccountHandler::getName()) {
DB::getInstance()->update('account', SessionAccountHandler::getId(), 'name', $_POST['name']);
}
if ($_POST['allow_mails'] != SessionAccountHandler::getAllowMails()) {
DB::getInstance()->update('account', SessionAccountHandler::getId(), 'allow_mails', $_POST['allow_mails']);
}
if ($_POST['language'] != SessionAccountHandler::getLanguage()) {
DB::getInstance()->update('account', SessionAccountHandler::getId(), 'language', $_POST['language']);
Language::setLanguage($_POST['language']);
echo Ajax::wrapJS('document.cookie = "lang=" + encodeURIComponent("' . addslashes($_POST['language']) . '");');
Ajax::setReloadFlag(Ajax::$RELOAD_PAGE);
}
if ($_POST['new_pw'] != '') {
$this->tryToChangePassword();
}
}
示例11: parsePostData
/**
* Parse all post values
*/
public function parsePostData()
{
$dataset = DB::getInstance()->query('SELECT `id` FROM `' . PREFIX . 'dataset` WHERE accountid = ' . SessionAccountHandler::getId())->fetchAll();
foreach ($dataset as $set) {
$id = $set['id'];
$modus = isset($_POST[$id . '_modus']) && $_POST[$id . '_modus'] == 'on' ? 2 : 1;
if (isset($_POST[$id . '_modus_3']) && $_POST[$id . '_modus_3'] == 3) {
$modus = 3;
}
$columns = array('modus', 'summary', 'position', 'style', 'class');
$values = array($modus, isset($_POST[$id . '_summary']) && $_POST[$id . '_summary'] == 'on' ? 1 : 0, isset($_POST[$id . '_position']) ? (int) $_POST[$id . '_position'] : '', isset($_POST[$id . '_style']) ? htmlentities($_POST[$id . '_style']) : '', isset($_POST[$id . '_class']) ? htmlentities($_POST[$id . '_class']) : '');
DB::getInstance()->update('dataset', $id, $columns, $values);
}
Cache::delete('Dataset');
Ajax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);
}