Connexion ou Créer un compte pour participer à la conversation.
protected function prepareTable( $table )
{
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
if (empty($table->id))
{
// Set the values
$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__icagenda_events'));
$db->setQuery($query);
$max = $db->loadResult();
$table->ordering = $max + 1;
}
}
else
{
// Set the values
$table->modified = $date->toSql();
$table->modified_by = $user->get('id');
}
}
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('modified'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('modified'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('modified_by'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('modified_by'); ?>
</div>
</div>
Connexion ou Créer un compte pour participer à la conversation.