[ Index ]

MailPress 7.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/ -> MP_Mailinglists_Walker_Checklist.class.php (source)

   1  <?php
   2  class MP_Mailinglists_Walker_Checklist extends Walker 
   3  {
   4      var $tree_type = MailPress_mailinglist::taxonomy;
   5      var $db_fields = array ( 'parent' => 'parent', 'id' => 'term_id' ); //TODO: decouple this
   6  
   7  	function start_lvl( &$output, $depth = 0, $args = array() ) 
   8      {
   9          $indent = str_repeat( "\t", $depth );
  10          $output .= $indent . '<ul class="children">' . "\n";
  11      }
  12  
  13  	function end_lvl( &$output, $depth = 0, $args = array() ) 
  14      {
  15          $indent = str_repeat( "\t", $depth );
  16          $output .= "$indent</ul>\n";
  17      }
  18  
  19  	public function start_el( &$output, $mailinglist, $depth = 0, $args = array(), $current_object_id = 0 )         
  20      {
  21          extract( $args );
  22  
  23          $class = in_array( $mailinglist->term_id, $popular_mailinglists ) ? ' class="popular-mailinglist"' : '';
  24          $output .= "\n" . '<li id="mailinglist-' . $mailinglist->term_id . '"' . $class . '><label for="in-mailinglist-' . $mailinglist->term_id . '" class="selectit"><input type="checkbox" name="' . $args['input_name'] . '" id="in-mailinglist-' . $mailinglist->term_id . '" value="' . $mailinglist->term_id . '"' . checked( in_array( $mailinglist->term_id, $selected_mailinglists ), true, false ) . ' /> ' . esc_html( $mailinglist->name ) . '</label>';
  25      }
  26  
  27  	function end_el( &$output, $mailinglist, $depth = 0, $args = array() ) 
  28      {
  29          $output .= "</li>\n";
  30      }
  31  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1