english/administrator/components/com_aicontactsafe/models/default.php
// function used to modify the field published to 1 or 0
function used to modify the field published to 1 or 0
function used to modify the field published to 1 or 0
function changePublish($state = 0) {
		JRequest::checkToken() or jexit( 'Invalid Token' );
		$db = & JFactory::getDBO();
		$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
		JArrayHelper::toInteger($cid);
		if (count($cid) > 0) {
			$cids = implode(',', $cid);
		} else {
			$cids = '-1';
		}
		$ctablename = $this->getTableName($this->_sTask, 'changePublish');
		$query = 'update '.$ctablename.' set published = ' . $state . ' where id IN ( ' . $cids . ' )';
		$db->setQuery($query);
		if (!$db->query()) {
			JError::raiseError( 500, $db->getErrorMsg() );
			return false;
		}
		return true;
	}
function changePublish ( $ state = 0 ) { JRequest :: checkToken ( ) or jexit ( 'Invalid Token' ) ; $ db = & JFactory :: getDBO ( ) ; $ cid = JRequest :: getVar ( 'cid' , array ( ) , 'post' , 'array' ) ; JArrayHelper :: toInteger ( $ cid ) ; if ( count ( $ cid ) > 0 ) { $ cids = implode ( ',' , $ cid ) ; } else { $ cids = '-1' ; } $ ctablename = $ this -> getTableName ( $ this -> _sTask , 'changePublish' ) ; $ query = 'update ' . $ ctablename . ' set published = ' . $ state . ' where id IN ( ' . $ cids . ' )' ; $ db -> setQuery ( $ query ) ; if ( ! $ db -> query ( ) ) { JError :: raiseError ( 500 , $ db -> getErrorMsg ( ) ) ; return false ; } return true ; }
function used to modify the field published to 1 or 0
function used to modify the field published to 1 or 0
// Check for request forgeries // initialize different variables // read the ids of the records seleted for publishing / unpublishing // update the value of the field published