function disable($val) { $xml = new xml($this->e); $nocache_xml = new xml($xml->documentURI(), $xml->de()->tagName, false); $users = new users($nocache_xml, $this->e->tagName); if ($usr = $users->getUser($this->getLogin())) { $val = $val ? 'disabled' : null; $usr->setDisabled($val); $nocache_xml->save(); $this->setDisabled($val); } }
static function applyTemplate($id_sec, $id_pckg) { global $_struct; $tl = apSectionTemplate::getPackages(); if (($tl = apSectionTemplate::getPackages()) && ($pckg = $tl->getById($id_pckg)) && ($apsec = $_struct->getSection($id_sec)) && ($clsec = ap::getClientSection($id_sec))) { if ($v = $pckg->getAttribute('class')) { $apsec->setClass($v); $clsec->setClass($v); $struct = new xml($clsec->getElement()); $struct->save(); } $ar = array('_ap' => $apsec->getXML(false), '_cl' => $clsec->getXML()); foreach ($ar as $attr => $xml) { if ($e = $tl->getXML()->query('section[@' . $attr . ']', $pckg)->item(0)) { $xml->removeChild(); if ($e = $xml->appendChild($xml->importNode($e))) { $e->removeAttribute($attr); $xml->save(); } } } } }