[ 'Feral', 'Balance', 'Guardian', 'Restoration', ], 'Death Knight' => [ 'Frost', 'Unholy', 'Blood' ], 'Evoker' => [ 'Augmentation', 'Devastation', 'Preservation', ], 'Warrior' => [ 'Arms', 'Fury', 'Protection', ], 'Paladin' => [ 'Holy', 'Protection', 'Retribution', ], 'Hunter' => [ 'Beast Mastery', 'Marksmanship', 'Survival', ], 'Rogue' => [ 'Assassination', 'Outlaw', 'Subtlety', ], 'Priest' => [ 'Discipline', 'Shadow', 'Holy', ], 'Shaman' => [ 'Elemental', 'Enhancement', 'Restoration', ], 'Mage' => [ 'Arcane', 'Fire', 'Frost', ], 'Warlock' => [ 'Affliction', 'Demonology', 'Destruction', ], 'Monk' => [ 'Brewmaster', 'Mistweaver', 'Windwalker', ], 'Demon Hunter' => [ 'Havoc', 'Vengeance', ], ]; public function hasSpec($specs) { foreach ($specs as $search) { if ($search) { return true; } } return false; } public function form($instance) { ?>
classes as $class => $specs) { $classname = sanitize($class); ?>

'radio', 'name' => esc_attr($this->get_field_name("classes[$class][$spec]]")), 'id' => esc_attr($this->get_field_id("classes[$class][$spec]]")) . "_0", 'value' => 0, 'text' => "Kein Bedarf", 'color' => $classname, 'icon_yes' => 'o-check', 'checked' => empty($instance['classes'][$class][$spec]), 'row' => false, 'fullHeight' => true, ]))->render(); ?> 'radio', 'name' => esc_attr($this->get_field_name("classes[$class][$spec]]")), 'id' => esc_attr($this->get_field_id("classes[$class][$spec]]")) . "_1", 'value' => 1, 'text' => "Niedrig", 'color' => $classname, 'icon_yes' => 'o-check', 'checked' => $instance['classes'][$class][$spec] == 1, 'row' => false, 'fullHeight' => true, ]))->render(); ?> 'radio', 'name' => esc_attr($this->get_field_name("classes[$class][$spec]]")), 'id' => esc_attr($this->get_field_id("classes[$class][$spec]]")) . "_2", 'value' => 2, 'text' => "Mittel", 'color' => $classname, 'icon_yes' => 'o-check', 'checked' => $instance['classes'][$class][$spec] == 2, 'row' => false, 'fullHeight' => true, ]))->render(); ?> 'radio', 'name' => esc_attr($this->get_field_name("classes[$class][$spec]]")), 'id' => esc_attr($this->get_field_id("classes[$class][$spec]]")) . "_3", 'value' => 3, 'text' => "Hoch", 'color' => $classname, 'icon_yes' => 'o-check', 'checked' => $instance['classes'][$class][$spec] == 3, 'row' => false, 'fullHeight' => true, ]))->render(); ?>
classes as $class => $specs) { foreach ($specs as $spec) { $instance['classes'][$class][$spec] = (!empty($new_instance['classes'][$class][$spec])) ? strip_tags($new_instance['classes'][$class][$spec]) : ''; } } return $instance; } }