original_string: protected function section_edit_control_menu($controls, $course, $section) {
          $o = "";
          if (!empty($controls)) {
              $menu = new action_menu();
              $menu->set_menu_trigger(get_string('edit'));
              $menu->attributes['class'] .= ' section-actions';
              foreach ($controls as $value) {
                  $url = empty($value['url']) ? '' : $value['url'];
                  $icon = empty($value['icon']) ? '' : $value['icon'];
                  $name = empty($value['name']) ? '' : $value['name'];
                  $attr = empty($value['attr']) ? array() : $value['attr'];
                  $class = empty($value['pixattr']['class']) ? '' : $value['pixattr']['class'];
                  $al = new action_menu_link_secondary(
                      new moodle_url($url),
                      new pix_icon($icon, '', null, array('class' => "smallicon " . $class)),
                      $name,
                      $attr
                  );
                  $menu->add($al);
              }
  
              $o .= html_writer::div($this->render($menu), 'section_action_menu',
                  array('data-sectionid' => $section->id));
          }
  
          return $o;
      }
code: protected function section_edit_control_menu($controls, $course, $section) {
          $o = "";
          if (!empty($controls)) {
              $menu = new action_menu();
              $menu->set_menu_trigger(get_string('edit'));
              $menu->attributes['class'] .= ' section-actions';
              foreach ($controls as $value) {
                  $url = empty($value['url']) ? '' : $value['url'];
                  $icon = empty($value['icon']) ? '' : $value['icon'];
                  $name = empty($value['name']) ? '' : $value['name'];
                  $attr = empty($value['attr']) ? array() : $value['attr'];
                  $class = empty($value['pixattr']['class']) ? '' : $value['pixattr']['class'];
                  $al = new action_menu_link_secondary(
                      new moodle_url($url),
                      new pix_icon($icon, '', null, array('class' => "smallicon " . $class)),
                      $name,
                      $attr
                  );
                  $menu->add($al);
              }
  
              $o .= html_writer::div($this->render($menu), 'section_action_menu',
                  array('data-sectionid' => $section->id));
          }
  
          return $o;
      }
code_tokens: protected function section_edit_control_menu ( $ controls , $ course , $ section ) { $ o = "" ; if ( ! empty ( $ controls ) ) { $ menu = new action_menu ( ) ; $ menu -> set_menu_trigger ( get_string ( 'edit' ) ) ; $ menu -> attributes [ 'class' ] .= ' section-actions' ; foreach ( $ controls as $ value ) { $ url = empty ( $ value [ 'url' ] ) ? '' : $ value [ 'url' ] ; $ icon = empty ( $ value [ 'icon' ] ) ? '' : $ value [ 'icon' ] ; $ name = empty ( $ value [ 'name' ] ) ? '' : $ value [ 'name' ] ; $ attr = empty ( $ value [ 'attr' ] ) ? array ( ) : $ value [ 'attr' ] ; $ class = empty ( $ value [ 'pixattr' ] [ 'class' ] ) ? '' : $ value [ 'pixattr' ] [ 'class' ] ; $ al = new action_menu_link_secondary ( new moodle_url ( $ url ) , new pix_icon ( $ icon , '' , null , array ( 'class' => "smallicon " . $ class ) ) , $ name , $ attr ) ; $ menu -> add ( $ al ) ; } $ o .= html_writer :: div ( $ this -> render ( $ menu ) , 'section_action_menu' , array ( 'data-sectionid' => $ section -> id ) ) ; } return $ o ; }
docstring: Generate the edit control action menu
  
  @param array $controls The edit control items from section_edit_control_items
  @param stdClass $course The course entry from DB
  @param stdClass $section The course_section entry from DB
  @return string HTML to output.
docstring_tokens: Generate the edit control action menu