/** * Read POST params and set given attribute by them * * @param Attr_type $at */ function set_attr_type_by_post(&$at) { $at->set_name($_POST['attr_name']); $at->set_type($_POST['attr_type']); $at->set_description($_POST['attr_label']); $at->set_order($_POST['attr_order']); $at->set_access($_POST['attr_access']); if (!empty($_POST['attr_new_group'])) { $at->set_group($_POST['attr_new_group']); } else { $at->set_group($_POST['attr_group']); } if (!empty($_POST['for_ser'])) { $at->set_for_ser(); } else { $at->reset_for_ser(); } if (!empty($_POST['for_serweb'])) { $at->set_for_serweb(); } else { $at->reset_for_serweb(); } if (!empty($_POST['pr_uri'])) { $at->set_for_URIs(); } else { $at->reset_for_URIs(); } if (!empty($_POST['pr_user'])) { $at->set_for_users(); } else { $at->reset_for_users(); } if (!empty($_POST['pr_domain'])) { $at->set_for_domains(); } else { $at->reset_for_domains(); } if (!empty($_POST['pr_global'])) { $at->set_for_globals(); } else { $at->reset_for_globals(); } if (!empty($_POST['multivalue'])) { $at->set_multivalue(); } else { $at->reset_multivalue(); } if (!empty($_POST['registration'])) { $at->set_registration(); } else { $at->reset_registration(); } if (!empty($_POST['required'])) { $at->set_required(); } else { $at->reset_required(); } }