summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-10 22:45:58 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-10 22:45:58 +0000
commit11b98e4f60ef2b5f44acec824a19386235f79dba (patch)
tree7d2c43883872c6d3f3783eab380e53dab4d4b305 /includes
parent4335a60b97a0ee0ca6be3e1aec14482e9aaaee8f (diff)
downloadbrdo-11b98e4f60ef2b5f44acec824a19386235f79dba.tar.gz
brdo-11b98e4f60ef2b5f44acec824a19386235f79dba.tar.bz2
#637712 by c960657 and Dave Reid: Fixed Fieldset is back in user registration form.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ecfd1a4a7..39c1ea14a 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5421,6 +5421,36 @@ function element_children(&$elements, $sort = FALSE) {
}
/**
+ * Return the visibile children of an element.
+ *
+ * @param $elements
+ * The parent element.
+ * @return
+ * The array keys of the element's visible children.
+ */
+function element_get_visible_children(array $elements) {
+ $visible_children = array();
+
+ foreach (element_children($elements) as $key) {
+ $child = $elements[$key];
+
+ // Skip un-accessible children.
+ if (isset($child['#access']) && !$child['#access']) {
+ continue;
+ }
+
+ // Skip value and hidden elements, since they are not rendered.
+ if (isset($child['#type']) && in_array($child['#type'], array('value', 'hidden'))) {
+ continue;
+ }
+
+ $visible_children[$key] = $child;
+ }
+
+ return array_keys($visible_children);
+}
+
+/**
* Provide theme registration for themes across .inc files.
*/
function drupal_common_theme() {