function do_disableDashlet() { $sNamespace = KTUtil::arrayGet($_REQUEST, 'fNamespace'); $iUserId = $this->oUser->getId(); if (empty($sNamespace)) { $this->errorRedirectToMain('No dashlet specified.'); exit(0); } // do the "delete" $this->startTransaction(); $aParams = array('sNamespace' => $sNamespace, 'iUserId' => $iUserId); $oDD = KTDashletDisable::createFromArray($aParams); if (PEAR::isError($oDD)) { $this->errorRedirectToMain('Failed to disable the dashlet.'); } $this->commitTransaction(); $this->successRedirectToMain('Dashlet disabled.'); }
function &getForUserAndDashlet($iUserId, $sNamespace) { $sWhereClause = 'WHERE user_id = ? AND dashlet_namespace = ?'; $aParams = array($iUserId, $sNamespace); return KTDashletDisable::getList(array($sWhereClause, $aParams)); }