/** * Wrap the generated item. * * @since 4.0.0 * @return string */ private function wrap_item($item, $id, $item_id, $class, $title, $label, $description, $master, $hint) { $description = $description ? $this->add_description($description) : ''; $class = 'cherry-section-' . $this->options['pattern'] . ' ' . $class; $master_class = preg_replace('/\\s*,\\s*/', ' ', $master); $class .= !empty($master_class) && isset($master_class) ? ' ' . $master_class : ''; $hint_html = ''; $data_master = !empty($master) ? 'data-master="' . $master . '"' : ''; $output = '<div id="wrap-' . $id . '" class="' . $class . '" ' . $data_master . '>'; $output .= $title ? $this->add_title($title) : ''; $export_check = new UI_Switcher(array('id' => $id . '-exclusion', 'name' => 'exclusion[' . $item_id . ']', 'value' => 'false', 'class' => 'exclusion-switcher', 'style' => 'small', 'toggle' => array('true_toggle' => __('Yes', 'cherry'), 'false_toggle' => __('No', 'cherry')))); $output .= sprintf('<div class="exclusion-check"><span>%1$s</span>%2$s</div>', __('Use for partial export', 'cherry'), $export_check->render()); if ($this->options['pattern'] == 'inline') { $output .= $this->add_label($id, $label) . $item . $description; } else { if ($hint) { $ui_tooltip = new UI_Tooltip(array('id' => $id . '-tooltip', 'hint' => $hint, 'class' => $class)); $hint_html .= $ui_tooltip->render(); } $output .= '<div class="cherry-col-1">' . $this->add_label($id, $label) . $description . $hint_html . '</div>'; $output .= '<div class="cherry-col-2">' . $item . '</div>'; } $output .= '</div>'; return $output; }
/** * Wrap the generated item. * * @since 4.0.0 * @return string */ private function wrap_item($item, $id, $class, $title, $label, $description, $hint) { $description = $description ? $this->add_description($description) : ''; $class = 'cherry-section-' . $this->options['pattern'] . ' ' . $class; $output = '<div id="wrap-' . $id . '" class="' . $class . '">'; $output .= $title ? $this->add_title($title) : ''; $hint_html = ''; if ($this->options['pattern'] == 'inline') { $output .= $this->add_label($id, $label) . $item . $description; } else { if ($hint) { $ui_tooltip = new UI_Tooltip(array('id' => $id . '-tooltip', 'hint' => $hint, 'class' => $class)); $hint_html .= $ui_tooltip->render(); } $output .= '<div class="cherry-col-1">' . $this->add_label($id, $label) . $description . $hint_html . '</div>'; $output .= '<div class="cherry-col-2">' . $item . '</div>'; } $output .= '</div>'; return $output; }
/** * Wrap the generated item. * * @since 4.0.0 * @return string */ private function wrap_item($item, $id, $class, $title, $label, $description, $master, $hint) { $description = $description ? $this->add_description($description) : ''; $class = 'cherry-section-' . $this->options['pattern'] . ' ' . $class; $master_class = preg_replace('/\\s*,\\s*/', ' ', $master); $class .= !empty($master_class) && isset($master_class) ? $master_class : ''; $data_master = !empty($master) ? 'data-master="' . $master . '"' : ''; $output = '<div id="wrap-' . $id . '" class="' . $class . '" ' . $data_master . '>'; $output .= $title ? $this->add_title($title) : ''; $hint_html = ''; if ($this->options['pattern'] == 'inline') { $output .= $this->add_label($id, $label) . $item . $description; } else { if ($hint) { $ui_tooltip = new UI_Tooltip(array('id' => $id . '-tooltip', 'hint' => $hint, 'class' => $class)); $hint_html .= $ui_tooltip->render(); } $output .= '<div class="cherry-col-1">' . $this->add_label($id, $label) . $description . $hint_html . '</div>'; $output .= '<div class="cherry-col-2">' . $item . '</div>'; } $output .= '</div>'; return $output; }