Edit Style body<= {'user'}; my $u = LJ::get_authas_user($authas); return LJ::bad_input("You could not be authenticated as the specified user") unless $u; # check styles cap return LJ::bad_input("Your account type doesn't permit you to modify styles.") unless LJ::get_cap($u, "styles"); # get a style object my $styleid = $POST{'styleid'}+0; my $style = LJ::S1::get_style($styleid); return LJ::bad_input("The requested style does not exist.") unless $style; # some static data my @style_opts = ( { 'code' => "is_public", 'title' => 'Public?', 'des' => "Mark this style public if you want other people to be able to use it or copy it." }, { 'code' => "is_embedded", 'title' => 'Embedded?', 'des' => "Is this style designed to be embedded in somebody's homepage? Check if so, otherwise it's a full page style." }, { 'code' => "is_colorfree", 'title' => 'Color Free?', 'des' => "A style is color-free if it does not contain any hard-coded color tags, but only uses the generic color codes listed in the table below." }, ); my @style_transforms = ( { 'trans' => 'lc', 'des' => "Lower case." }, { 'trans' => 'uc', 'des' => "Upper case." }, { 'trans' => 'ue', 'des' => "URL-Encode. Turn spaces to +, and all weird characters to %hh, the hex representation. This is useful for building data files to be used in Flash-4 movies." }, { 'trans' => 'xe', 'des' => "XML-Encode. Makes value acceptable for use in an XML attribute or element. Escapes ampersands, angle brackets, and both types of quotes. Does not however, escape ]]>, so don't use CDATA elements." }, { 'trans' => 'color', 'des' => "A weird transform that handles color codes. See the color code table." }, { 'trans' => 'cons', 'des' => "Access site constants. Currently supported are 'siteroot', 'sitename', and 'img' (the image root). Example use: %%cons:img%%/icon_protected.gif" }, { 'trans' => 'ljuser', 'des' => "Transform the variable as if it were surrounded by <lj user=%%variable%%>. ex: %%ljuser:username%%" }, { 'trans' => 'ljcomm', 'des' => "Transform the variable as if it were surrounded by <lj comm=%%variable%%>. ex: %%ljcomm:username%%" }, { 'trans' => 'userurl', 'des' => 'Takes in a username and transforms it into a link to their journal.' }, ); # construct ide and mode variables my $ide = $POST{'ide'}; my $mode = $POST{'mode'} || 'editstyle'; if ($mode eq 'editstyle') { if ($ide eq 'delete') { $mode = 'delete'; } else { $ide = $ide eq 'v1' ? 'v1' : 'v2'; $mode = 'editstyle'; } } ### start of output my $ret = ""; # pass authas arguments in forms if necessary my $getextra = "?authas=$authas" if $authas ne $remote->{'user'}; # delete confirmation if ($mode eq "delete") { $ret .= "$style->{'styledes'}? If so, press the button below. This will temporarily break your journal if you're using this style, until you select a different style to use. p?>"; $ret .= "
\n"; return $ret; } # process delete if ($mode eq "delete_confirm") { LJ::S1::delete_style($styleid); return "here. p?>"; } # editing a style if ($mode eq "editstyle") { $ret .= "\n"; $ret .= ""; # convenience links at bottom if ($ide eq 'v2') { $ret .= "