/** * Attends un objet de type textpage en paramètre. */ function _createContent(&$toReturn) { $tpl =& new CopixTpl(); $arAllCapabilitiesPath = CopixProfileTools::getCapabilitiesPath(); //$capabilities = CopixProfileTools::getCapabilities (); $capabilitiesPath = array(); //value of capabilities $values = array(); //adds capabilities to the paths. foreach ($arAllCapabilitiesPath as $path => $capabilityPath) { $capabilities = CopixProfileTools::getCapabilitiesForPath($path); foreach ($capabilities as $capability) { if ($capability->name_ccpb == $this->params['capability']) { $capabilitiesPath[$path] = $capabilityPath; $capabilitiesPath[$path]->currentValue = isset($this->params['group']->_capabilities[$path][$this->params['capability']]) ? $this->params['group']->_capabilities[$path][$this->params['capability']] : null; $values = $capability->values_ccpb; } } } //Assigning values to the template $tpl->assign('capabilityValues', $values); $tpl->assign('arCapabilityPath', $capabilitiesPath); $tpl->assign('arCapabilitiesCaptions', $this->_buildCapabilitiesValues()); $tpl->assign('capability', $this->params['capability']); //appel du template. $toReturn = $tpl->fetch('capability.list.tpl'); return true; }
function _createContent(&$toReturn) { $tpl =& new CopixTpl(); $capabilities = CopixProfileTools::getCapabilities(); //Assigning values to the template $tpl->assign('capabilities', $capabilities); //appel du template. $toReturn = $tpl->fetch('capability.kind.tpl'); return true; }
/** * @param $this->params['group'] */ function _createContent(&$toReturn) { $tpl =& new CopixTpl(); $arTempCapabilities = CopixProfileTools::getCapabilities(); $arCapabilities = array(); //make array of current capability foreach ($this->params['group']->_capabilities as $path => $currentCapabilities) { foreach ($arTempCapabilities as $index => $capability) { if (isset($currentCapabilities[$capability->name_ccpb])) { $arCapabilities[$index] = $capability; } } } //assignation de la liste des profils connus. $tpl->assign('group', $this->params['group']); $tpl->assign('arCapabilitiesCaptions', $this->_buildCapabilitiesValues()); $tpl->assign('arCapabilities', $arCapabilities); $tpl->assign('arCapabilitiesPath', $arCapabilitiesPath = CopixProfileTools::getCapabilitiesPath()); //appel du template. $toReturn = $tpl->fetch('group.edit.tpl'); return true; }
/** * deletes all the related path. */ function deleteCapabilityPath($path) { $dao =& CopixDAOFactory::create('copix:CopixCapabilityPath'); $daoGroupCapabilities =& CopixDAOFactory::create('copix:CopixGroupCapabilities'); //gets the moved list. $listToDelete = CopixProfileTools::getList($path); //moves the element childs. foreach ((array) $listToDelete as $pathToDelete) { $daoGroupCapabilities->removePath($pathToDelete); $dao->delete($pathToDelete); } //moves the element itself $daoGroupCapabilities->removePath($path); $dao->delete($path); }
/** * ajout de capacités. */ function doAddCapabilities() { $profile = $this->_getSessionData(); $arAllCapabilitiesPath = CopixProfileTools::getCapabilitiesPath(); $capabilitiesPath = array(); //adds capabilities to the paths.. foreach ($arAllCapabilitiesPath as $path => $capabilityPath) { $capabilities = CopixProfileTools::getCapabilitiesForPath($path); foreach ($capabilities as $capability) { if ($capability->name_ccpb == $this->vars['capability']) { $capabilitiesPath[$path] = $capabilityPath; } } } foreach ($capabilitiesPath as $path => $capabilityPath) { //echo 'test de', $capabilityPath->name_ccpt, '<br />'; //echo 'valeur', $this->vars[urlencode ($capabilityPath->name_ccpt)]; if ($this->vars[urlencode($capabilityPath->name_ccpt)] != '') { $profile->setCapability($path, $this->vars['capability'], $this->vars[urlencode($capabilityPath->name_ccpt)]); } else { $profile->removeCapability($path, $this->vars['capability']); } } //$profile->addCapabilities ((array) $this->vars['selectedCapabilities']); $this->_setSessionData($profile); return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('profile|admin|edit')); }