/** * Overrides theme_file_widget(). */ function bootstrap_file_widget($variables) { $element = $variables['element']; $output = ''; $hidden_elements = array(); foreach (element_children($element) as $child) { if (isset($element[$child]['#type']) && $element[$child]['#type'] === 'hidden') { $hidden_elements[$child] = $element[$child]; unset($element[$child]); } } $element['upload_button']['#prefix'] = '<span class="input-group-btn">'; $element['upload_button']['#suffix'] = '</span>'; // The "form-managed-file" class is required for proper Ajax functionality. if (!empty($element['filename'])) { $output .= '<div class="file-widget form-managed-file clearfix">'; // Add the file size after the file name. $element['filename']['#markup'] .= ' <span class="file-size badge">' . format_size($element['#file']->filesize) . '</span>'; } else { $output .= '<div class="file-widget form-managed-file clearfix input-group">'; } $output .= drupal_render_children($element); $output .= '</div>'; $output .= render($hidden_elements); return $output; }
/** * Builds the Toolbar as a structured array ready for drupal_render(). * * Since building the toolbar takes some time, it is done just prior to * rendering to ensure that it is built only if it will be displayed. * * @param array $element * A renderable array. * * @return array * A renderable array. * * @see toolbar_page_build(). */ public static function preRenderToolbar($element) { // Get the configured breakpoints to switch from vertical to horizontal // toolbar presentation. $breakpoints = static::breakpointManager()->getBreakpointsByGroup('toolbar'); if (!empty($breakpoints)) { $media_queries = array(); foreach ($breakpoints as $id => $breakpoint) { $media_queries[$id] = $breakpoint->getMediaQuery(); } $element['#attached']['js'][] = array('data' => array('toolbar' => array('breakpoints' => $media_queries)), 'type' => 'setting'); } $module_handler = static::moduleHandler(); // Get toolbar items from all modules that implement hook_toolbar(). $items = $module_handler->invokeAll('toolbar'); // Allow for altering of hook_toolbar(). $module_handler->alter('toolbar', $items); // Sort the children. uasort($items, array('\\Drupal\\Component\\Utility\\SortArray', 'sortByWeightProperty')); // Merge in the original toolbar values. $element = array_merge($element, $items); // Render the children. $element['#children'] = drupal_render_children($element); return $element; }
/** * Overrides theme_file_widget(). */ function bootstrap_file_widget($variables) { $output = ''; $element = $variables['element']; $element['upload_button']['#attributes']['class'][] = 'btn-primary'; $element['upload_button']['#prefix'] = '<span class="input-group-btn">'; $element['upload_button']['#suffix'] = '</span>'; // The "form-managed-file" class is required for proper Ajax functionality. if (!empty($element['filename'])) { $output .= '<div class="file-widget form-managed-file clearfix">'; // Add the file size after the file name. $element['filename']['#markup'] .= ' <span class="file-size badge">' . format_size($element['#file']->filesize) . '</span>'; } else { $output .= '<div class="file-widget form-managed-file clearfix input-group">'; } // Immediately render hidden elements before the rest of the output. // The uploadprogress extension requires that the hidden identifier input // element appears before the file input element. They must also be siblings // inside the same parent element. // @see https://www.drupal.org/node/2155419 foreach (element_children($element) as $child) { if (isset($element[$child]['#type']) && $element[$child]['#type'] === 'hidden') { $output .= drupal_render($element[$child]); } } // Render the rest of the element. $output .= drupal_render_children($element); $output .= '</div>'; return $output; }
function mortgagespeak_preprocess_user_login_block(&$vars) { $vars['name'] = render($vars['form']['name']); $vars['pass'] = render($vars['form']['pass']); $vars['submit'] = render($vars['form']['actions']['submit']); $vars['rendered'] = drupal_render_children($vars['form']); }
/** * Overrides theme_file_managed_file(). */ function springy_file_managed_file($variables) { $element = $variables['element']; $attributes = array(); if (isset($element['#id'])) { $attributes['id'] = $element['#id']; } if (!empty($element['#attributes']['class'])) { $attributes['class'] = (array) $element['#attributes']['class']; } $attributes['class'][] = 'form-managed-file'; $attributes['class'][] = 'input-group'; $element['upload_button']['#prefix'] = '<span class="input group-btn">'; $element['upload_button']['#suffix'] = '</span>'; $element['remove_button']['#prefix'] = '<span class="input group-btn">'; $element['remove_button']['#suffix'] = '</span>'; if (!empty($element['filename'])) { $element['filename']['#prefix'] = '<div class="form-control">'; $element['filename']['#suffix'] = '</div>'; } $hidden_elements = array(); foreach (element_children($element) as $child) { if ($element[$child]['#type'] === 'hidden') { $hidden_elements[$child] = $element[$child]; unset($element[$child]); } } // This wrapper is required to apply JS behaviors and CSS styling. $output = ''; $output .= '<div' . drupal_attributes($attributes) . '>'; $output .= drupal_render_children($element); $output .= '</div>'; $output .= render($hidden_elements); return $output; }
function creative_preprocess_user_login_block(&$vars) { $vars['form']['name']['#title'] = 'AUC Username'; $vars['name'] = render($vars['form']['name']); $vars['pass'] = render($vars['form']['pass']); $vars['submit'] = render($vars['form']['actions']['submit']); $vars['rendered'] = drupal_render_children($vars['form']); }
function marketplace_preprocess_user_login_block(&$vars) { $vars['form']['links']['#markup'] = '<div class="links">Not a member? <a href="' . base_path() . 'user/register">Sign up now</a></div>'; $vars['name'] = render($vars['form']['name']); $vars['pass'] = render($vars['form']['pass']); $vars['submit'] = render($vars['form']['actions']['submit']); $vars['rendered'] = drupal_render_children($vars['form']); }
/** * Custom function to pull the Published check box out and make it obvious. */ function ninesixtyrobots_article_node_form($variables) { $form = $variables['form']; $published = drupal_render($form['status']); $buttons = drupal_render($form['actions']); // Make sure we also render the rest of the form, not just our custom stuff. $everything_else = drupal_render_children($form); return $everything_else . $published . $buttons; }
function bootstrap_hpc_preprocess_contact_site_form(&$valt) { //dpm($valt['']); $valt['message'] = render($valt['form']['message']); $valt['subject'] = render($valt['form']['subject']); $valt['actions'] = render($valt['form']['actions']); $valt['rendered_form'] = drupal_render_children($valt['form']); //dpm($valt); }
/** * {@inheritdoc} */ public function build() { $id = $this->getDerivativeId(); $data = drupal_static('ds_block_region'); if (!empty($data[$id])) { return array('#markup' => drupal_render_children($data[$id])); } else { return array(); } }
public function doRenderChildren($object) { if (null === $object || [] === $object) { return ''; } if (!is_array($object)) { throw new \InvalidArgumentException("render_children() input must be an array"); } return drupal_render_children($object); }
/** * Returns HTML for a date selection form element. * * @param array $variables * An associative array containing: * - element: An associative array containing the properties of the element. * Properties used: #title, #value, #options, #description, #required, * #attributes. * * @return string * The constructed HTML. * * @see theme_date() * * @ingroup theme_functions */ function bootstrap_date($variables) { $element = $variables['element']; $attributes = array(); if (isset($element['#id'])) { $attributes['id'] = $element['#id']; } if (!empty($element['#attributes']['class'])) { $attributes['class'] = (array) $element['#attributes']['class']; } $attributes['class'][] = 'form-inline'; return '<div' . drupal_attributes($attributes) . '>' . drupal_render_children($element) . '</div>'; }
/** * Overrides theme_devconnect_monetization_roles_form(). */ function apigee_responsive_devconnect_monetization_roles_form($variables) { $form = $variables['form']; $rows = array(); foreach (element_children($form['developers']) as $uid) { $row = array(); foreach (element_children($form['developers'][$uid]) as $element) { $row[] = drupal_render($form['developers'][$uid][$element]); } $rows[] = array('data' => $row); } $output = '<div class="table-responsive">' . theme_table(array('header' => $form['#table_headers'], 'rows' => $rows, 'attributes' => array('class' => array('table', 'table-bordered')), 'caption' => '', 'colgroups' => array(), 'sticky' => TRUE, 'empty' => t('Your company has no developers assigned.'))) . '</div>' . drupal_render($form['submit']) . drupal_render_children($form); return $output; }
function bootstrap_preprocess_user_register(&$variables) { $variables['form']['account']['name']['#title'] = 'choose a username'; $variables['form']['account']['name']['#attributes'] = array('data-placeholder' => $variables['form']['account']['name']['#title']); $variables['form']['account']['mail']['#title'] = 'your email address'; $variables['form']['account']['mail']['#attributes'] = array('data-placeholder' => $variables['form']['account']['mail']['#title']); $variables['form']['account']['pass']['pass1']['#title'] = 'Set a password'; $variables['form']['account']['pass']['pass1']['#attributes'] = array('data-placeholder' => $variables['form']['account']['pass']['pass1']['#title'], 'data-input-type' => 'password'); $variables['form']['account']['pass']['pass2']['#type'] = 'textfield'; $variables['form']['account']['pass']['pass2']['#theme'] = 'textfield'; $variables['form']['account']['pass']['pass2']['#autocomplete_path'] = ''; $variables['form']['account']['pass']['pass2']['#title'] = 'Confirm a password'; $variables['form']['account']['pass']['pass2']['#attributes'] = array('data-placeholder' => $variables['form']['account']['pass']['pass2']['#title'], 'data-input-type' => 'password'); $variables['form']['actions']['submit']['#value'] = 'create my account'; unset($variables['form']['account']['name']['#size']); unset($variables['form']['account']['mail']['#size']); unset($variables['form']['account']['pass']['pass1']['#size']); unset($variables['form']['account']['pass']['pass2']['#size']); $variables['rendered'] = drupal_render_children($variables['form']); }
/** * Overrides theme_exposed_filters(). */ function bootstrap_exposed_filters($variables) { $form = $variables['form']; $output = ''; foreach (element_children($form['status']['filters']) as $key) { $form['status']['filters'][$key]['#field_prefix'] = '<div class="col-sm-10">'; $form['status']['filters'][$key]['#field_suffix'] = '</div>'; } $form['status']['actions']['#attributes']['class'][] = 'col-sm-offset-2'; $form['status']['actions']['#attributes']['class'][] = 'col-sm-10'; if (isset($form['current'])) { $items = array(); foreach (element_children($form['current']) as $key) { $items[] = drupal_render($form['current'][$key]); } $output .= theme('item_list', array('items' => $items, 'attributes' => array('class' => array('clearfix', 'current-filters')))); } $output .= drupal_render_children($form); return '<div class="form-horizontal">' . $output . '</div>'; }
/** * Returns HTML for a theme's color form. * Removes the mini-preview * @todo rework and implement the fullsize live preview from tundra 1.0 */ function tundra_color_scheme_form($variables) { $form = $variables['form']; $theme = $form['theme']['#value']; $info = $form['info']['#value']; $output = ''; $output .= '<div class="color-form clearfix">'; // Color schemes $output .= drupal_render($form['scheme']); // Palette $output .= '<div id="palette" class="clearfix">'; foreach (element_children($form['palette']) as $name) { $output .= drupal_render($form['palette'][$name]); } $output .= '</div>'; // Preview $output .= drupal_render_children($form); // Close the wrapper div. $output .= '</div>'; return $output; }
/** * Returns HTML for a managed file element. * * @param array $variables * An associative array containing: * - element: A render element representing the file. * * @return string * The constructed HTML. * * @see theme_file_managed_file() * * @ingroup theme_functions */ function bootstrap_file_managed_file($variables) { $output = ''; $element = $variables['element']; $attributes = array(); if (isset($element['#id'])) { $attributes['id'] = $element['#id']; } if (!empty($element['#attributes']['class'])) { $attributes['class'] = (array) $element['#attributes']['class']; } $attributes['class'][] = 'form-managed-file'; $attributes['class'][] = 'input-group'; $element['upload_button']['#attributes']['class'][] = 'btn-primary'; $element['upload_button']['#prefix'] = '<span class="input-group-btn">'; $element['upload_button']['#suffix'] = '</span>'; $element['remove_button']['#prefix'] = '<span class="input-group-btn">'; $element['remove_button']['#suffix'] = '</span>'; $element['remove_button']['#attributes']['class'][] = 'btn-danger'; if (!empty($element['filename'])) { $element['filename']['#prefix'] = '<div class="form-control">'; $element['filename']['#suffix'] = '</div>'; } // This wrapper is required to apply JS behaviors and CSS styling. $output .= '<div' . drupal_attributes($attributes) . '>'; // Immediately render hidden elements before the rest of the output. // The uploadprogress extension requires that the hidden identifier input // element appears before the file input element. They must also be siblings // inside the same parent element. // @see https://www.drupal.org/node/2155419 foreach (element_children($element) as $child) { if (isset($element[$child]['#type']) && $element[$child]['#type'] === 'hidden') { $output .= drupal_render($element[$child]); } } // Render the rest of the element. $output .= drupal_render_children($element); $output .= '</div>'; return $output; }
/** * Returns HTML for an image field widget. * * @param array $variables * An associative array containing: * - element: A render element representing the image field widget. * * @ingroup themeable */ function bootstrap_image_widget($variables) { $element = $variables['element']; $output = ''; $output .= '<div class="image-widget form-managed-file clearfix">'; if (isset($element['preview'])) { $output .= '<div class="image-preview">'; $output .= drupal_render($element['preview']); $output .= '</div>'; } $output .= '<div class="image-widget-data">'; if ($element['fid']['#value'] != 0) { $element['filename']['#markup'] = '<div class="form-group">' . $element['filename']['#markup'] . ' <span class="file-size badge">' . format_size($element['#file']->filesize) . '</span></div>'; } else { $element['upload']['#prefix'] = '<div class="input-group">'; $element['upload_button']['#prefix'] = '<span class="input-group-btn">'; $element['upload_button']['#suffix'] = '</span></div>'; } $output .= drupal_render_children($element); $output .= '</div>'; $output .= '</div>'; return $output; }
function hoithi_preprocess_user_register_form(&$vars) { //thisinh $thisinh_role = user_role_load_by_name('thisinh'); if ($thisinh_role) { $vars['form']['account']['roles'][$thisinh_role->rid]['#checked'] = TRUE; } $vars['name'] = render($vars['form']['account']['name']); $vars['mail'] = render($vars['form']['account']['mail']); $vars['pass'] = render($vars['form']['account']['pass']); $vars['roles'] = render($vars['form']['account']['roles']); $vars['hovaten'] = render($vars['form']['field_hovaten']); $vars['hovaten'] = render($vars['form']['field_hovaten']); $vars['ngaysinh'] = render($vars['form']['field_ngaysinh']); $vars['gioitinh'] = render($vars['form']['field_gioitinh']); $vars['sodienthoai'] = render($vars['form']['field_sodienthoai']); $vars['socmnd'] = render($vars['form']['field_socmnd']); $vars['ngaycap'] = render($vars['form']['field_ngaycap']); $vars['noicap'] = render($vars['form']['field_noicap']); $vars['quequan'] = render($vars['form']['field_quequan']); //$vars['submit'] = render($vars['form']['actions']['submit']); $vars['rendered'] = drupal_render_children($vars['form']); }
/** * Override of theme('menu_local_task'). */ function wetkit_rubik_menu_local_task($variables) { $link = $variables['element']['#link']; $link_text = $link['title']; if (!empty($variables['element']['#active'])) { // Add text to indicate active tab for non-visual users. $active = '<span class="element-invisible">' . t('(active tab)') . '</span>'; // If the link does not contain HTML already, check_plain() it now. // After we set 'html'=TRUE the link will not be sanitized by l(). if (empty($link['localized_options']['html'])) { $link['title'] = check_plain($link['title']); } $link['localized_options']['html'] = TRUE; $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active)); } // Render child tasks if available. $children = ''; if (element_children($variables['element'])) { $children = drupal_render_children($variables['element']); $children = "<ul class='secondary-tabs links clearfix'>{$children}</ul>"; } return '<li' . (!empty($variables['element']['#active']) ? ' class="active"' : '') . '>' . l($link_text, $link['href'], $link['localized_options']) . $children . "</li>\n"; }
function neb_system_modules_uninstall($variables) { $form = $variables['form']; // No theming for the confirm form. if (isset($form['confirm'])) { return drupal_render($form); } // Table headers. $header = array(t('Uninstall'), t('Name'), t('Description')); // Display table. $rows = array(); foreach (element_children($form['modules']) as $module) { if (!empty($form['modules'][$module]['#required_by'])) { $disabled_message = format_plural(count($form['modules'][$module]['#required_by']), 'To uninstall @module, the following module must be uninstalled first: @required_modules', 'To uninstall @module, the following modules must be uninstalled first: @required_modules', array('@module' => $form['modules'][$module]['#module_name'], '@required_modules' => implode(', ', $form['modules'][$module]['#required_by']))); $disabled_message = '<div class="error warning admin-requirements">' . $disabled_message . '</div>'; } else { $disabled_message = ''; } $rows[] = array(array('data' => drupal_render($form['uninstall'][$module]), 'align' => 'center'), '<label for="' . $form['uninstall'][$module]['#id'] . '">' . drupal_render($form['modules'][$module]['name']) . '</label>', array('data' => drupal_render($form['modules'][$module]['description']) . $disabled_message, 'class' => array('description'))); } $output = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No modules are available to uninstall.'))); $output .= drupal_render_children($form); return $output; }
function wellingtonbuilders_preprocess_user_login_block(&$variables) { // Add a custom placeholder to username field. $variables['form']['name']['#value'] = $variables['form']['name']['#title']; $variables['form']['name']['#attributes']['placeholder'] = t('Username'); //$variables['form']['name']['#attributes']['onblur'] = "if (this.value == '') {this.value = '".$variables['form']['name']['#value']."';} ;"; //$variables['form']['name']['#attributes']['onfocus'] = "if (this.value == '".$variables['form']['name']['#value']."') {this.value = '';} ;"; // Add a custom placeholder to password field. // this will not work until you clicked in input, to make this work see <a href="http://drupal.org/node/75225" title="http://drupal.org/node/75225"rel="nofollow">http://drupal.org/node/75225</a> and apply the patch. There are security implications to doing this. $variables['form']['pass']['#value'] = $variables['form']['pass']['#title']; $variables['form']['pass']['#attributes']['placeholder'] = t('Password'); // $variables['form']['pass']['#attributes']['onblur'] = "if (this.value == '') {this.value = '".$variables['form']['pass']['#value']."';} ;"; //$variables['form']['pass']['#attributes']['onfocus'] = "if (this.value == '".$variables['form']['pass']['#value']."') {this.value = '';} ;"; // Remove the "Username" & "Password" labels from the form. unset($variables['form']['name']['#title']); unset($variables['form']['pass']['#title']); // Change the text on the submit button, use CSS to make it an image if you would like $variables['form']['actions']['submit']['#value'] = t('SUBMIT'); // Remove links //unset($variables['form']['links']); $variables['form']['name']['#required'] = false; $variables['form']['pass']['#required'] = false; $variables['rendered'] = drupal_render_children($variables['form']); }
<div class="newsletter-popup-form"> <div class="np-email clearfix"> <div class="np-error" style="display: none;">Email non valida</div> <?php echo drupal_render($variables['form']['email']); ?> <span class="np-submit"> <?php echo drupal_render($variables['form']['submit']); ?> </span> </div> <?php echo drupal_render_children($variables['form']); ?> </div>
<div class="e-group clearfix"> <h4 class="pull-left"><?php print t('Add Superliga sleeve brand!'); ?> </h4> <?php print $preview_badge_button; ?> </div> <?php print drupal_render($form['field_jersey_print'][0]['field_superliga_badge']); ?> <div class='e-badge-value e-attribute-price-preview'></div> <div class="e-group clearfix"> <h4 class="pull-left"><?php print t('Add autographs from FCK squad!'); ?> </h4> <?php print $preview_autograph_button; ?> </div> <?php print drupal_render($form['field_jersey_print'][0]['field_autograph']); ?> <div class='e-autograph-value e-attribute-price-preview'></div> <?php print drupal_render_children($form);
<p><?php print render($intro_text); ?> </p> <div class="nomad-user-login-form-wrapper"> <?php $output = render($variables['form']['name']); $output .= render($variables['form']['pass']); $output .= drupal_render_children($variables['form']); print $output; ?> </div>
function designmd_preprocess_contact_site_form(&$vars) { $vars['contact'] = drupal_render_children($vars['form']); }
function zen_nmu_preprocess_user_login(&$variables) { $variables['login_link'] = t('saml_login'); $variables['rendered'] = drupal_render_children($variables['form']); }
<td> <img id="portrait" style="height:300px;width:200px;" src="" /> <div id="portrait-dlt" class="hide"><br/><br/> <a class="ui-button ui-widget ui-state-default ui-button-text-icon-primary" onclick="javascript:alert('work-in-progress')"> <span class="ui-button-icon-primary ui-icon ui-icon-circle-close"></span> <span class="ui-button-text">Delete Image</span> </a> </div> </td><td><br/><br/> <img id="landscape" style="height:200px;width:300px;" src="" /> <div id="landscape-dlt" class="hide"><br/><br/><br/><br/> <a class="ui-button ui-widget ui-state-default ui-button-text-icon-primary" onclick="javascript:alert('work-in-progress')"> <span class="ui-button-icon-primary ui-icon ui-icon-circle-close"></span> <span class="ui-button-text">Delete Image</span> </a> </div> </td> </tr><tr> <td><div class="file-upload"><?php echo drupal_render($form['portrait']); ?> </div></td> <td><div class="file-upload"><?php echo drupal_render($form['landscape']); ?> </div></td> </tr> </table> <?php echo drupal_render_children($form);
/** * Implements theme_legal_login(). */ function devis_legal_login($variables) { $output = ''; $form = $variables['form']; $form['legal']['#title'] = ''; $form = theme('legal_display', array('form' => $form)); // If the changes exist, display them in a new fieldset and delete the // module layout for the changes. if (isset($form['changes'])) { $form['changes_new'] = array('#type' => 'fieldset', '#title' => t('Les modifications apportées aux conditions générales'), '#description' => '', '#collapsible' => FALSE, '#collapsed' => FALSE, '#tree' => TRUE); $form['changes_new']['bullet_points'] = array('#markup' => $form['changes']['bullet_points']['#markup']); $output .= drupal_render($form['changes_new']); unset($form['changes']); } $save = drupal_render($form['save']); $output .= drupal_render_children($form); /*global $language; $conditions = legal_get_conditions($language->language); $conditions = $conditions['conditions']; $output .= '<div id="dialog" title="'. t('Termes et conditions') .'">'. $conditions .'</div>';*/ $output .= $save; return $output; }
* webform_analysis, webform_analysis_CONTENTTYPE, or webform_analysis_NID * view. * - 'form': A form for selecting which components should be included in the * analysis. * - 'data': An render array of analysis results for each component enabled. */ ?> <div class="webform-analysis"> <?php print drupal_render($analysis['form']['help']); ?> <?php print drupal_render($analysis['exposed_filter']); ?> <div class="webform-analysis-data"> <?php print drupal_render($analysis['data']); ?> </div> <?php print drupal_render($analysis['form']); ?> <?php /* Print out any remaining part of the renderable. */ ?> <?php print drupal_render_children($analysis); ?> </div>