Sidebar control panel for smooth sailing

Jan 13, 2007 18:37

set layout_sidebox_freetext_10_visibility = "12";
set text_sidebox_freetext_10_title = "Control Panel";


function Page::lay_print_sidebar_freetextbox_10() {
# create helper vars for sidebar boxes
var string k1Sheader = "";
var string k1Sheader_one = """
  • """;
    var string k1Sheader_two = "
  • ";
    var string k1Scontent = "";
    var string k1Scontent_one = """
  • """;
    var string k1Scontent_two = "
  • ";

    ##################################
    # CONTROL PANEL COMPONENT #
    # kunzite1, component-help/82952 #
    # add to print_free_text(Page p) #
    ##################################
    # Title bar of component when logged in
    var string k1CPloggedInTitle = "your control panel";

    # Title bar of component when not logged in
    var string k1CPloggedOutTitle = "login box";

    # LOGIN BOX
    # Label for entering username
    var string k1CPusername = "user:";

    # Label for entering password
    var string k1CPpassword = "pw:";

    # Label for forgot password link
    var string k1CPforgot = "forgot?";

    # Label for expiration options
    var string k1CPexpiration = "expiration:";

    # Label for expiring when window closes
    var string k1CPclose = "window close";

    # Label for never expiring
    var string k1CPnever = "never";

    # Label for binding to ip
    var string k1CPbind = "bind to ip:";

    # Label for accepting binding to ip
    var string k1CPy = "yes";

    # Label for denying binding to ip
    var string k1CPn = "no";

    # Label for log in button
    var string k1CPsubmit = "log in";

    #######################
    # CONTROL PANEL START #
    #######################
    var string k1CPpanel = "";
    var string k1CPheader = viewer_logged_in() ? $k1CPloggedInTitle : $k1CPloggedOutTitle;
    if(viewer_logged_in()){
    var string k1CPmedLineString = "#DFDFDF";
    var int k1CPcols = 2;

    var string[] k1CPlink_urls = [""];
    var string[] k1CPlink_texts = [""];
    var int k1CPlink_index = 0;

    # set one
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/customize/";
    $k1CPlink_texts[$k1CPlink_index] = "customize";
    $k1CPlink_index++;

    # set two
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/customize/advanced/";
    $k1CPlink_texts[$k1CPlink_index] = "advanced";
    $k1CPlink_index++;

    # set three
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/customize/advanced/layers.bml";
    $k1CPlink_texts[$k1CPlink_index] = "layers";
    $k1CPlink_index++;

    # set four
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/customize/advanced/styles.bml";
    $k1CPlink_texts[$k1CPlink_index] = "styles";
    $k1CPlink_index++;

    # set five
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/manage/links.bml";
    $k1CPlink_texts[$k1CPlink_index] = "link lists";
    $k1CPlink_index++;

    # set six
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/update.bml";
    $k1CPlink_texts[$k1CPlink_index] = "update";
    $k1CPlink_index++;

    # set seven
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/editjournal.bml";
    $k1CPlink_texts[$k1CPlink_index] = "edit entries";
    $k1CPlink_index++;

    # set eight
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/friends/";
    $k1CPlink_texts[$k1CPlink_index] = "edit friends";
    $k1CPlink_index++;
    # set nine
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/editinfo.bml";
    $k1CPlink_texts[$k1CPlink_index] = "edit info";
    $k1CPlink_index++;

    # set ten
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/changepassword.bml";
    $k1CPlink_texts[$k1CPlink_index] = "edit pass";
    $k1CPlink_index++;

    # set eleven
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/editpics.bml";
    $k1CPlink_texts[$k1CPlink_index] = "edit pics";
    $k1CPlink_index++;

    # set twelve
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/tools/memories.bml";
    $k1CPlink_texts[$k1CPlink_index] = "memories";
    $k1CPlink_index++;

    # set thirteen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/misc/whereami.bml";
    $k1CPlink_texts[$k1CPlink_index] = "my cluster";
    $k1CPlink_index++;

    # set fourteen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/portal/";
    $k1CPlink_texts[$k1CPlink_index] = "my portal";
    $k1CPlink_index++;

    # set fifteen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/site/";
    $k1CPlink_texts[$k1CPlink_index] = "site map";
    $k1CPlink_index++;

    # set sixteen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/stats.bml";
    $k1CPlink_texts[$k1CPlink_index] = "site stats";
    $k1CPlink_index++;

    # set seventeen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/birthdays.bml";
    $k1CPlink_texts[$k1CPlink_index] = "birthdays";
    $k1CPlink_index++;

    # set eighteen
    $k1CPlink_urls[$k1CPlink_index] = "$*SITEROOT/logout.bml";
    $k1CPlink_texts[$k1CPlink_index] = "logout";
    $k1CPlink_index++;

    var int k1CPcount = 0;
    var string k1CPwidth = (100 / $k1CPcols) + "%";
    $k1CPpanel = $k1CPpanel + """\n""";
    foreach var int i (0 .. size($k1CPlink_urls) - 1) {
    var string url = $k1CPlink_urls[$i];
    var string text = $k1CPlink_texts[$i];
    $k1CPcount++;
    if($k1CPcount == 1) {
    $k1CPpanel = $k1CPpanel + " \n";
    }
    $k1CPpanel = $k1CPpanel + """ $text\n""";
    if($k1CPcount == $k1CPcols) {
    $k1CPpanel = $k1CPpanel + " \n";
    $k1CPcount = 0;
    }
    }
    if($k1CPcount > 0) {
    foreach var int i ($k1CPcount .. $k1CPcols) {
    if($i < $k1CPcols) {
    $k1CPpanel = $k1CPpanel + "  \n";
    } else {
    $k1CPpanel = $k1CPpanel + " \n";
    }
    }
    }
    $k1CPpanel = $k1CPpanel + """""";
    } else {
    $k1CPpanel = $k1CPpanel + """

    """;
    }
    $this->lay_print_sidebox_top($*text_sidebox_freetext_10_title);
    """

    $k1Scontent_one$k1CPpanel$k1Scontent_two
    """;
    # print box
    $this->lay_print_sidebox_bottom();
    }

    and this went in the css section:

    li.sbark1CP
    {
    padding-left: 0px;
    padding-right: 0px;
    list-style: none;

    }

    smooth sailing

    Previous post Next post
    Up