[theme] - [flexisquares] - [add links to header]

Dec 13, 2005 17:47


function Page::lay_print_header() "Prints header" {
# get title
var string title = $this->title();

# start header
and

    """

      """;

      # create helper vars for text and urls for links
      var string text = "";
      var string url = "";

      # get website name and url
      $text = $.journal.website_name ? $.journal.website_name : $*text_website_default_name;
      $url = $.journal.website_url;

      # if website, print it
      if($url != "") {
      println """
    • $text
    • """;
      }

      # cycle thru views order
      foreach var string v ($.views_order) {
      # get text and url
      $text = lang_viewname($v);
      $url = $.view_url{$v};

      # if current view, just print text
      if ($.view == $v) {
      """
    • $text
    • """;
      } else {
      # if not current view, print link
      println """
    • $text
    • """;
      }
      }

      # create arrays for custom links, also create index meter
      var string[] texts = [];
      var string[] urls = [];
      var int index = 0;

      # set one
      $texts[$index] = "Memories";
      $urls[$index] = "$*SITEROOT/tools/memories.bml?user=$.journal.username";
      $index++;

      # set two
      $texts[$index] = "Yahoo!";
      $urls[$index] = "http://www.yahoo.com/";
      $index++;

      # cycle thru links
      foreach var int i (0 .. size($urls)) {
      # get text and url
      $text = $texts[$i];
      $url = $urls[$i];

      # print link
      println """
    • $text
    • """;
      }

      # close
        , print title

        """


      $title

      """;

      # print subtitle if it exists and we're not on friends view
      if($.global_subtitle != "" and $.view != "friends") {
      """

      $.global_subtitle

      """;
      }

      # close header

      """

      """;
      }

layout flexisquares, class page, function lay_print_header

Previous post Next post
Up