Пример #1
0
 public function display_stage_2()
 {
     echo X::_o('form', array('class' => 'form-horizontal', 'method' => 'post')), X::_o('fieldset'), X::legend('2'), X::div(array('class' => 'form-group row'), X::label(array('class' => 'col-sm-4 control-label'), 'Manga URL'), X::div(array('class' => 'col-sm-8 controls'), X::input(array('type' => 'text', 'class' => 'form-control', 'name' => 'base', 'value' => @$this->base)))), X::div(array('class' => 'form-group row'), X::label(array('class' => 'col-sm-4 control-label'), 'Prefix'), X::div(array('class' => 'col-sm-4 controls'), X::input(array('type' => 'text', 'class' => 'form-control', 'name' => 'prefix', 'value' => @$this->prefix)))), X::_o('div', array('class' => 'form-group row')), X::label(array('class' => 'col-sm-4 control-label'), 'Choose chapter'), X::_o('div', array('class' => 'col-sm-8 controls')), X::label(array('class' => 'checkbox'), X::input(array('type' => 'checkbox', 'name' => 'all', 'onclick' => 'click_this()')), ' All'), X::div(array('class' => 'input-append'), X::input(array('id' => 'parse_it', 'class' => 'form-control', 'type' => 'text')), X::button(array('type' => 'button', 'onclick' => 'check_it()', 'class' => 'btn'), 'Check'), X::button(array('type' => 'button', 'onclick' => 'uncheck_it()', 'class' => 'btn'), 'Uncheck')), X::br(), X::_o('table', array('class' => 'table table-condensed')), X::thead(X::tr(X::th(array('class' => 'span1'), '#'), X::th(array('class' => 'span4'), 'Chapter Name'), X::th('Infix'))), X::_o('tbody');
     if (isset($this->stage1)) {
         $list = $this->extract_info($this->base);
         if ($this->reverse_choice_chapters) {
             $list = array_reverse($list, true);
         }
         foreach ($list as $i => $v) {
             $this->print_choice($i, $v);
         }
     } else {
         // from POST
         foreach ($this->info as $i => $v) {
             if (isset($v['check'])) {
                 $this->print_choice($i, $v);
             } else {
                 unset($this->info[$i]);
             }
         }
     }
     echo X::_c('tbody'), X::_c('table'), X::_c('div'), X::_c('div'), X::div(array('class' => 'col-md-offset-4'), X::button(array('class' => 'btn btn-primary', 'type' => 'submit', 'name' => 'stage2'), 'Submit')), X::_c('fieldset'), X::_c('form');
 }