# Selima Website Content Management System # Rebuild.pm: The web page rebuild form. # Copyright (c) 2006-2018 imacat. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Author: imacat # First written: 2006-04-04 package Selima::Form::Rebuild; use 5.008; use strict; use warnings; use base qw(Selima::Form); use Selima::HTTP; use Selima::MarkAbbr; use Selima::PageFunc; use Selima::ShortCut; # new: Initialize the HTML form table displayer sub new : method { local ($_, %_); my ($class, $status, $args, $self); ($class, $status, $args) = @_; $args = {} if !defined $args; # $args must be a hash reference http_500 "type of argument 2 must be a hash reference" if ref($args) ne "HASH"; $$args{"type"} = "new" if !exists $$args{"type"}; $$args{"type_to_pass"} = undef if !exists $$args{"type_to_pass"}; $$args{"valid_types"} = [qw(new)] if !exists $$args{"valid_types"}; $$args{"cols"} = [qw(type)] if !exists $$args{"cols"}; $$args{"title"} = C_("Rebuild the Pages") if !exists $$args{"title"}; $$args{"header_buttons"} = [] if !exists $$args{"header_buttons"}; $$args{"footer_buttons"} = [ { "name" => "confirm", "value" => h(C_("Confirm")) }, { "name" => "cancel", "value" => h(C_("Cancel")) } ] if !exists $$args{"footer_buttons"}; $$args{"auto_referer2"} = 0 if !exists $$args{"auto_referer2"}; $self = $class->SUPER::new($status, $args); return $self; } # _html_col_type: The page type sub _html_col_type : method { $_[0]->_html_coltmpl_select("type", h_abbr(C_("Type:")), \&rebuildtype_options, undef); } return 1;