コード例 #1
0
 /**
  * Shortcode admin interface
  */
 public function build_shortcode_editor_options()
 {
     $html = '';
     $source = array();
     if (isset($_POST['shortcode_object'])) {
         $source = $_POST['shortcode_object'];
     }
     $html .= OTW_Form::select(array('id' => 'otw-shortcode-element-tabs', 'label' => $this->get_label('Number'), 'description' => $this->get_label('Select number of tabs.'), 'parse' => $source, 'options' => $this->settings['tabs'], 'value' => $this->settings['default_tabs'], 'data-reload' => '1'));
     $html .= OTW_Form::select(array('id' => 'otw-shortcode-element-style', 'label' => $this->get_label('Style'), 'description' => $this->get_label('Horizontal or vertical tabs.'), 'parse' => $source, 'options' => $this->settings['styles'], 'value' => $this->settings['default_style']));
     $html .= OTW_Form::text_input(array('id' => 'otw-shortcode-element-title', 'label' => $this->get_label('Tabs title'), 'description' => $this->get_label('Optional title for the tabs.'), 'parse' => $source));
     $total_tabs = $this->settings['default_tabs'];
     if (isset($source['otw-shortcode-element-tabs'])) {
         $total_tabs = $source['otw-shortcode-element-tabs'];
     }
     for ($cT = 1; $cT <= $total_tabs; $cT++) {
         $html .= OTW_Form::text_input(array('id' => 'otw-shortcode-element-tab_' . $cT . '_title', 'label' => $this->get_label('Tab ' . $cT . ' title'), 'description' => $this->get_label('The tab title.'), 'parse' => $source));
         $html .= OTW_Form::select(array('id' => 'otw-shortcode-element-tab_' . $cT . '_icon_type', 'label' => $this->get_label('Tab ' . $cT . ' icon'), 'description' => $this->get_label('Optional foundation icon that is placed before the title.'), 'parse' => $source, 'options' => $this->settings['icon_types'], 'value' => $this->settings['default_icon_type']));
         $html .= OTW_Form::uploader(array('id' => 'otw-shortcode-element-tab_' . $cT . '_icon_url', 'label' => $this->get_label('Tab ' . $cT . ' Icon URL'), 'description' => $this->get_label('Url to a custom icon.'), 'parse' => $source));
         $html .= OTW_Form::text_area(array('id' => 'otw-shortcode-element-tab_' . $cT . '_content', 'label' => $this->get_label('Tab ' . $cT . ' content'), 'description' => $this->get_label('The content of the tab. HTML is allowed.'), 'parse' => $source));
     }
     return $html;
 }