コード例 #1
0
 /**
  * Returns instance ACL roles
  */
 protected function getInstanceRoles()
 {
     $result = array('' => translate('LBL_UW_DO_NOT_MAP_ROLE'));
     $roles = MBHelper::getRoles();
     foreach ($roles as $role) {
         $result[$role->id] = $role->name;
     }
     return $result;
 }
コード例 #2
0
 /**
  * Returns object storage containing available roles as keys
  * and flags indicating if there is role specific metadata as value
  *
  * @param MetaDataImplementationInterface $implementation
  * @return SplObjectStorage
  */
 protected function getRoleList(MetaDataImplementationInterface $implementation)
 {
     return MBHelper::getRoles($this->getHasMetaCallback($implementation));
 }
コード例 #3
0
ファイル: StudioModule.php プロジェクト: jglaine/sugar761-ent
 /**
  * Removes a field from the layouts that it is on
  * 
  * @param string $fieldName The name of the field to remove
  */
 public function removeFieldFromLayouts($fieldName)
 {
     require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
     $GLOBALS['log']->info(get_class($this) . "->removeFieldFromLayouts({$fieldName})");
     $sources = $this->getViewMetadataSources();
     $sources[] = array('type' => MB_BASICSEARCH);
     $sources[] = array('type' => MB_ADVANCEDSEARCH);
     $sources[] = array('type' => MB_POPUPSEARCH);
     $sources = array_merge($sources, $this->getWirelessLayouts());
     $sources = array_merge($sources, $this->getPortalLayoutSources());
     $GLOBALS['log']->debug(print_r($sources, true));
     require_once 'modules/ModuleBuilder/MB/MBHelper.php';
     $roles = MBHelper::getRoles();
     foreach ($sources as $name => $defs) {
         $this->removeFieldFromLayout($this->module, $defs['type'], null, $fieldName);
         foreach ($roles as $role) {
             $this->removeFieldFromLayout($this->module, $defs['type'], null, $fieldName, array('role' => $role->id));
         }
     }
     //Remove the fields in subpanel
     $data = $this->getParentModulesOfSubpanel($this->module);
     foreach ($data as $parentModule) {
         $this->removeFieldFromLayout($parentModule, MB_LISTVIEW, $this->module, $fieldName);
     }
 }