On a support role today
In a previous version of JCook not such a long time ago, we still had the Function Published() which allowed me to do other stuff with a record when it was published / unpublished when toggling on the grid layout.. In a fault system I created, if someone turned status to unpublished, it would record a lot more info.. example below
function publish($cid = array(), $publish = 1)
{
$user = JFactory::getUser();
if (count( $cid ))
{
JArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$user = JFactory::getUser();
$query = 'UPDATE #__traindefectlogger_defects'
. ' SET `published` = '.(int) $publish
. ', `date_closed` = "'.date('y-m-j', time()).'"'
. ', `time_closed` = "'.date('H:i:s', time()).'"'
. ', `closed_by` = '.(int) $user->id
. ' WHERE id IN ( '.$cids.' )'
;
$this->_db->setQuery( $query );
if (!$this->_db->query()) {
JError::raiseWarning(1000, $this->_db->getErrorMsg());
return false;
}
}
return true;
}
as you can see when someone toggled to unpublished, it would record date, time, who did it.. awesome stuff!
In the latest iteration of JCook, this is just not possible as the publish function has gone, and is now just handled in the DOM HTML as a generic function
Can anyone give me a starting point for being to replicate the above custom publishing code for ONE view in the latest iteration of JCook