kunzite (kunzite1) wrote in s2layers,
kunzite
kunzite1
s2layers

[theme] - [component] - [print_my_components()]

function print_my_components(Page p) {
# figure out if we're set to print any comps
var bool show_comps = ($*comp_state == "left") or ($*comp_state == "right");
$show_comps = ($p.view == "friends") ? $*comp_friends : $show_comps;

if($show_comps) {

# set width of component column
var int width = 184;

# get order from properties
var string[] orders = [$*first_position, $*second_position, $*third_position, $*fourth_position, $*fifth_position, $*sixth_position];

# see if we're going to print any standard comps
var bool standard_comps = (($*first_position != "") and ($*first_position != "none")) or (($*second_position != "") and ($*second_position != "none")) or (($*third_position != "") and ($*third_position != "none")) or (($*fourth_position != "") and ($*fourth_position != "none")) or (($*fifth_position != "") and ($*first_position != "none")) or (($*sixth_position != "") and ($*sixth_position != "none"));

if($standard_comps) {
"""
<td valign="top" width="$width">
  <table cellspacing="0" cellpadding="0" border="0" width="$width">
""";
foreach var string order ($orders) {
  if($order == "profile_order") {
    if($*show_profile == true) {
      print_profile($p);
    }
  } elseif($order == "calendar_order") {
    if($*show_calendar == true) {
      print_calendar($p);
    }
  } elseif($order == "links_order") {
    if($*show_links == true) {
      print_links($p);
    }
  } elseif($order == "free_text_order") {
    if($*show_free_text == true) {
      print_free_text($p);
    }
  } elseif($order == "navigation_order") {
    if($*comp_navbar == true) {
      print_nav_comp($p);
    }
  } elseif($order == "summary_order") {
    if($*show_summary == true) {
      $p->lay_print_summary();
    }
  }
}
"""
  </table>
</td>
""";
}
}
}
Tags: !all, function print_my_components, layout component
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 4 comments