/**
  * metabox content for all template pack and variation selection.
  *
  * @since 4.5.0
  *
  * @return string
  */
 public function template_pack_meta_box()
 {
     $this->_set_message_template_group();
     $tp_collection = EEH_MSG_Template::get_template_pack_collection();
     $tp_select_values = array();
     foreach ($tp_collection as $tp) {
         //only include template packs that support this messenger and message type!
         $supports = $tp->get_supports();
         if (!isset($supports[$this->_message_template_group->messenger()]) || !in_array($this->_message_template_group->message_type(), $supports[$this->_message_template_group->messenger()])) {
             //not supported
             continue;
         }
         $tp_select_values[] = array('text' => $tp->label, 'id' => $tp->dbref);
     }
     //if empty $tp_select_values then we make sure default is set because EVERY message type should be supported by the default template pack.  This still allows for the odd template pack to override.
     if (empty($tp_select_values)) {
         $tp_select_values[] = array('text' => __('Default', 'event_espresso'), 'id' => 'default');
     }
     //setup variation select values for the currently selected template.
     $variations = $this->_message_template_group->get_template_pack()->get_variations($this->_message_template_group->messenger(), $this->_message_template_group->message_type());
     $variations_select_values = array();
     foreach ($variations as $variation => $label) {
         $variations_select_values[] = array('text' => $label, 'id' => $variation);
     }
     $template_pack_labels = $this->_message_template_group->messenger_obj()->get_supports_labels();
     $template_args['template_packs_selector'] = EEH_Form_Fields::select_input('MTP_template_pack', $tp_select_values, $this->_message_template_group->get_template_pack_name());
     $template_args['variations_selector'] = EEH_Form_Fields::select_input('MTP_template_variation', $variations_select_values, $this->_message_template_group->get_template_pack_variation());
     $template_args['template_pack_label'] = $template_pack_labels->template_pack;
     $template_args['template_variation_label'] = $template_pack_labels->template_variation;
     $template_args['template_pack_description'] = $template_pack_labels->template_pack_description;
     $template_args['template_variation_description'] = $template_pack_labels->template_variation_description;
     $template = EE_MSG_TEMPLATE_PATH . 'template_pack_and_variations_metabox.template.php';
     EEH_Template::display_template($template, $template_args);
 }
 /**
  * Retrieves an array of all template packs.
  * Array is in the format array( 'dbref' => EE_Messages_Template_Pack )
  * @deprecated 4.9.0  @see EEH_MSG_Template_Pack::get_template_pack_collection
  *
  * @return EE_Messages_Template_Pack[]
  */
 public static function get_template_packs()
 {
     EE_Registry::instance()->load_helper('MSG_Template');
     //for backward compat, let's make sure this returns in the same format as originally.
     $template_pack_collection = EEH_MSG_Template::get_template_pack_collection();
     $template_pack_collection->rewind();
     $template_packs = array();
     while ($template_pack_collection->valid()) {
         $template_packs[$template_pack_collection->current()->dbref] = $template_pack_collection->current();
         $template_pack_collection->next();
     }
     return $template_packs;
 }