. * * @package ReduxFramework * @subpackage Field_Info * @author Daniel J Griffiths (Ghost1227) * @author Dovy Paukstys * @author Abdullah Almesbahi * @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) exit; // Don't duplicate me! if (!class_exists('ReduxFramework_group')) { /** * Main ReduxFramework_info class * * @since 1.0.0 */ class ReduxFramework_group extends ReduxFramework { /** * Field Constructor. * * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function * * @since 1.0.0 * @access public * @return void */ public function __construct($field = array(), $value = '', $parent) { parent::__construct($parent->sections, $parent->args, $parent->extra_tabs); $this->field = $field; $this->value = $value; $this->parent = $parent; } /** * Field Render Function. * * Takes the vars and outputs the HTML for the field in the settings * * @since 1.0.0 * @access public * @return void */ public function render() { if (empty($this->value) || !is_array($this->value)) { $this->value = array( array( 'slide_title' => __('New', 'redux-framework').' '.$this->field['groupname'], 'slide_sort' => '0', ) ); } echo '
';
if(isset($field['class']))
$field['class'] .= " group";
else
$field['class'] = " group";
if (!empty($field['title']))
echo '' . $field['title'] . ''; if (!empty($field['subtitle'])) echo '' . $field['subtitle'] . ''; $value = empty($this->parent->options[$field['id']][$x]) ? " " : $this->parent->options[$field['id']][$x]; ob_start(); $this->parent->_field_input($field, $value); $content = ob_get_contents(); //adding sorting number to the name of each fields in group $name = $this->parent->args['opt_name'] . '[' . $field['id'] . ']'; $content = str_replace($name, $name . '[' . $x . ']', $content); //we should add $sort to id to fix problem with select field $content = str_replace(' id="'.$field['id'].'-select"', ' id="'.$field['id'].'-select-'.$sort.'"', $content); $_field = apply_filters('redux-support-group',$content, $field, $x); ob_end_clean(); echo $_field; echo ' |