else { runtimeSave($_REQUEST['layer_tablename'], TABLE_TYPE_LAYER); } break; case 'saveLinkData': require_once("save_info.php"); runtimeSave($_REQUEST['link_tablename'], TABLE_TYPE_LINK); break; case 'saveMetaLayer': require_once("save_info.php"); $fields=array(); $layer_tablename=$_REQUEST['layer_tablename']; $Request=$_REQUEST; $result=Meta_Layer::saveMetaLayer($Request, $layer_tablename); print $result; break; case 'saveLayerPermissions': require_once("save_info.php"); $for_role=$_REQUEST['for_role']; if ($for_role == '') { die("Error: Required parameters not set"); } $Request=$_REQUEST; print saveLayerPermissions($Request, $for_role); break; // save_info.php ends
function getInactiveLayers() { $arr_theme = array(); $user = $GLOBALS['user']; if ($user->uid) { $user_roles = $user->roles; if (in_array(SITE_ADMIN_ROLE, $user_roles)) { $query = 'select layer_tablename, layer_name, access, p_nid, participation_type from "Meta_Layer" where status = 0 order by layer_name;'; } else { $lyrs = array(); foreach($user_roles as $role) { if(substr($role, -6) == ' admin') { $lyrs[] = substr($role, 0, -6); } } if (sizeof($lyrs) > 0) { array_walk($lyrs, "singleQuoteString"); $str_lyrs = implode(",", $lyrs); $query = 'select layer_tablename, layer_name, access, p_nid, participation_type,layer_type from "Meta_Layer" where layer_tablename in ('.$str_lyrs.') and status = 0 order by layer_name;'; } } if ($query != '') { $arr_theme = Meta_Layer::getLayersInfoArray($query); } } return $arr_theme; }