本文整理汇总了PHP中Dataset::setActivityData方法的典型用法代码示例。如果您正苦于以下问题:PHP Dataset::setActivityData方法的具体用法?PHP Dataset::setActivityData怎么用?PHP Dataset::setActivityData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dataset
的用法示例。
在下文中一共展示了Dataset::setActivityData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayTrainingRows
/**
* Display all training rows
*/
private function displayTrainingRows()
{
foreach ($this->Trainings as $training) {
$date = date("d.m.Y", $training['time']);
$link = Ajax::trainingLink($training['id'], $date, true);
echo '<tr class="r">';
echo '<td class="l"><small>' . $link . '</small></td>';
$this->Dataset->setActivityData($training);
$this->Dataset->displayTableColumns();
echo '</tr>';
}
}
示例2: getCode
/**
* Get code
* @return string
*/
private function getCode()
{
$Code = '
<table class="c fullwidth zebra-style" id="conf-tab-dataset">
<thead>
<tr>
<th> </th>
<th>' . Ajax::tooltip(__('Display'), __('The information will be shown directly in the row.')) . '</th>
<th colspan="2">' . Ajax::tooltip(__('Summary'), __('The value will be summarized for the sport.')) . '</th>
<th>' . Ajax::tooltip(__('Order'), __('Indicates the order of appearance.')) . '</th>
<th>' . Ajax::tooltip(__('CSS-Class'), __('\'c\': centered<br>\'l\': left-aligned<br>\'small\': small<br>\'b\': bold')) . '</th>
<th>' . Ajax::tooltip(__('CSS-Style'), __('any CSS-Code')) . '</th>
<th>' . __('Example') . '</th>
</tr>
</thead>
<tbody>';
$Labels = new DatasetLabels();
$DatasetObject = new Dataset();
$DatasetObject->setActivityData($this->getExampleTraining());
$Dataset = DB::getInstance()->query('SELECT *, (`position` = 0) as `hidden` FROM `' . PREFIX . 'dataset` WHERE accountid = ' . SessionAccountHandler::getId() . ' ORDER BY (`position` > 0) DESC, `position` ASC')->fetchAll();
foreach ($Dataset as $pos => $Data) {
$disabled = $Data['modus'] == 3 ? ' disabled' : '';
$checked_2 = $Data['modus'] >= 2 ? ' checked' : '';
$checked = $Data['summary'] == 1 ? ' checked' : '';
$SummarySign = '';
switch ($Data['summary_mode']) {
case 'YES':
case 'NO':
$checked .= ' disabled';
break;
case 'AVG':
$SummarySign = 'Ø';
break;
case 'SUM':
$SummarySign = '∑';
break;
case 'MAX':
$SummarySign = 'max';
break;
}
$Example = $DatasetObject->getDataset($Data['name']);
$Code .= '
<tr class="r" id="' . $Data['id'] . '_tr">
<td class="l b">' . $Labels->get($Data['name']) . '</td>
<td class="c">
<input type="hidden" name="' . $Data['id'] . '_modus_3" value="' . $Data['modus'] . '">
<input type="checkbox" name="' . $Data['id'] . '_modus"' . $checked_2 . $disabled . '>
</td>
<td class="c"><input type="checkbox" name="' . $Data['id'] . '_summary"' . $checked . '></td>
<td class="c small">' . $SummarySign . '</td>
<td class="c">
<input class="dataset-position" type="text" name="' . $Data['id'] . '_position" value="' . ($pos + 1) . '" size="2">
<span class="link" onclick="datasetMove(' . $Data['id'] . ', \'up\')">' . Icon::$UP . '</span>
<span class="link" onclick="datasetMove(' . $Data['id'] . ', \'down\')">' . Icon::$DOWN . '</span>
</td>
<td class="c"><input type="text" name="' . $Data['id'] . '_class" value="' . $Data['class'] . '" size="7"></td>
<td class="c"><input type="text" name="' . $Data['id'] . '_style" value="' . $Data['style'] . '" size="15"></td>
<td class="' . $Data['class'] . '" style="' . $Data['style'] . '">' . $Example . '</td>
</tr>';
}
$Code .= '
</tbody>
</table>';
$Code .= Ajax::wrapJS('
function datasetMove(id, way) {
var pos = parseInt($("input[name=\'"+id+"_position\']").val()),
tr = $("#"+id+"_tr");
if (way == "up" && pos > 1) {
$("#"+id+"_tr .dataset-position").val(pos-1);
tr.prev().find(".dataset-position").val(pos);
tr.prev().toggleClass("swapped");
tr.prev().before(tr);
} else if (way == "down" && tr.next().find(".dataset-position").val() > 0) {
$("#"+id+"_tr .dataset-position").val(pos+1);
tr.next().find(".dataset-position").val(pos);
tr.next().toggleClass("swapped");
tr.next().after(tr);
}
tr.toggleClass("swapped");
}
');
return $Code;
}