You are here

function theme_asaf_examples in Asaf (ajax submit for any form) 7

Same name and namespace in other branches
  1. 8 modules/asaf_example/asaf_example.module \theme_asaf_examples()
1 theme call to theme_asaf_examples()
asaf_example_intro in modules/asaf_example/asaf_example.module

File

modules/asaf_example/asaf_example.module, line 142
AJAX Examples module file with basic examples.

Code

function theme_asaf_examples($variables) {
  $output = '';
  $element = $variables['element'];
  if (isset($element['#examples'])) {
    foreach ($element['#examples'] as $group) {
      $output .= '<div class="examples-group">';
      if (isset($group['name'])) {
        $output .= '<h2>' . $group['name'] . '</h2>';
      }
      if (isset($group['description'])) {
        $output .= '<div class="description">' . $group['description'] . '</div>';
      }
      $output .= '<ol>';
      foreach ($group['items'] as $example) {
        $output .= '<li>' . $example . '</li>';
      }
      $output .= '</ol>';
      $output .= '</div>';
    }
  }
  return $output;
}