SHARE
TWEET

Untitled

big_smile Feb 22nd, 2014 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Call to Action Function
  3.  */
  4. function legendarysettings_call_to_action(&$cta_settings, &$cta_settings_2, &$custom_text, &$custom_link, &$custom_prompt, &$custom_text_2, &$custom_link_2)
  5. {
  6.     $output = null;
  7.     if (isset($cta_settings->content)) {
  8.         if (legendarysettings_views_field_compare_value($cta_settings, 'cta_main')) {
  9.             $cta_prompt = (theme_get_setting('cta_main_prompt_text'));
  10.             $cta_button = (theme_get_setting('cta_main_button_text'));
  11.             $cta_link   = (theme_get_setting('cta_main_node'));
  12.         }
  13.         if (legendarysettings_views_field_compare_value($cta_settings, 'cta_secondary')) {
  14.             $cta_prompt = (theme_get_setting('cta_secondary_prompt_text'));
  15.             $cta_button = (theme_get_setting('cta_secondary_button_text'));
  16.             $cta_link   = (theme_get_setting('cta_secondary_node'));
  17.         }
  18.         if (legendarysettings_views_field_compare_value($cta_settings, 'cta_custom')) {
  19.             $cta_prompt = $custom_prompt;
  20.             $cta_button = $custom_text;
  21.             $cta_link   = $custom_link;
  22.         }
  23.                 $second_test = 'FAIL';
  24.  
  25.             if (legendarysettings_views_field_compare_value($cta_settings_2, 'second_cta_main')) {
  26.                 $second_cta_prompt = (theme_get_setting('cta_main_prompt_text'));
  27.                 $second_cta_button = (theme_get_setting('cta_main_button_text'));
  28.                 $second_cta_link   = (theme_get_setting('cta_main_node'));
  29.                 $second_test = 'Success';
  30.             }
  31.             if (legendarysettings_views_field_compare_value($cta_settings_2, 'second_cta_secondary')) {
  32.                 $second_cta_button = (theme_get_setting('cta_secondary_button_text'));
  33.                 $second_cta_link   = (theme_get_setting('cta_secondary_node'));
  34.             }
  35.             if (legendarysettings_views_field_compare_value($cta_settings_2, 'second_cta_custom')) {
  36.                 $second_cta_button = $custom_text_2;
  37.                 $second_cta_link   = $custom_link_2;
  38.             }
  39.  
  40.         $cta_enabled = true;
  41.  
  42.         if (legendarysettings_views_field_compare_value($cta_settings, 'cta_none')) {
  43.             $cta_enabled = false;
  44.         }
  45.  
  46.         if (theme_get_setting('admin_cta') == 0) {
  47.             $cta_enabled = false;
  48.         }
  49.         $second_cta_class   = "second-cta";
  50.         $second_cta_enabled = true;
  51.  
  52.         if (theme_get_setting('admin_second_cta') == 0) {
  53.             $second_cta_enabled = false;
  54.         }
  55.  
  56.         if (legendarysettings_views_field_compare_value($cta_settings_2, 'second_cta_none')) {
  57.             $second_cta_enabled = false;
  58.         }
  59.  
  60.         if ($second_cta_enabled == false) {
  61.             $second_cta_class = '';
  62.         }
  63.  
  64.         if ($cta_enabled == true) {
  65.             $output = '<div class="unit-footer cta-outro ' . $second_cta_class . '">';
  66.             $output .= '<p>' . $cta_prompt . '</p>';
  67.             $output .= '<a href=" print $cta_link; " class="cta">' . $cta_button . '</a>';
  68.  
  69.             if ($second_cta_enabled == true) {
  70.                 $output .= '<a href="' . $second_cta_link . '" class="cta">' . $second_cta_button . '</a>';
  71.             }
  72.         }
  73.     }
  74.  
  75.    
  76.     print $output;
  77. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top