WYSIJA_help_quick_html

The MailPoet Newsletters WYSIJA help quick html class.

Defined (1)

The class is defined in the following location(s).

/helpers/quick_html.php  
  1. class WYSIJA_help_quick_html extends WYSIJA_object { 
  2.  
  3. function __construct() { 
  4. parent::__construct(); 
  5.  
  6. /** 
  7. * quickly renders a row of 3 sales argument with a picture a title and description with an eventual link 
  8. * pretty handy for the update page/welcome page and premium page 
  9. * @param type $arguments the array includes 3 array with this format (key, title, desc, link, img) 
  10. * @param type $cta_links the link in the descriptive text will be rendered as a button 
  11. * @return string 
  12. */ 
  13. function three_arguments($arguments, $cta_links = false) { 
  14. $html = $class_link = ''; 
  15. $count = 1; 
  16. foreach ($arguments as $sale_argument) { 
  17. if (isset($sale_argument['link'])) { 
  18. if($cta_links) $class_link = 'class="argument-cta"'; 
  19. $sale_argument['desc'] = str_replace(array('[link]', '[/link]'), array('<a '.$class_link.' href="' . $sale_argument['link'] . '" target="_blank">', '</a>'), $sale_argument['desc']); 
  20. if($count==3) $sale_argument['key'] .= ' last-feature'; 
  21. $html .= '<div class="col-'.$count.' '.$sale_argument['key'].'">'; 
  22.  
  23. if(isset($sale_argument['img'])) $html .= '<img src="'.$sale_argument['img'].'">'; 
  24. $html .= '<h3>'.$sale_argument['title'].'</h3> 
  25. <p>'.$sale_argument['desc'].'</p> 
  26. </div>'; 
  27. $count++; 
  28.  
  29. return $html;