<?php /**
 * Redux Framework is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * any later version.
 *
 * Redux Framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Redux Framework. If not, see <http://www.gnu.org/licenses/>.&#13;
 *&#13;
 * @package     ReduxFramework&#13;
 * @subpackage  Field_Editor&#13;
 * @author      Daniel J Griffiths (Ghost1227)&#13;
 * @author      Dovy Paukstys&#13;
 * @version     3.0.0&#13;
 */&#13;
&#13;
// Exit if accessed directly&#13;
if( !defined( 'ABSPATH' ) ) exit;&#13;
&#13;
// Don't duplicate me!&#13;
if( !class_exists( 'ReduxFramework_editor' ) ) {&#13;
&#13;
    /**&#13;
     * Main ReduxFramework_editor class&#13;
     *&#13;
     * @since       1.0.0&#13;
     */&#13;
    class ReduxFramework_editor extends ReduxFramework {&#13;
    &#13;
        /**&#13;
         * Field Constructor.&#13;
         *&#13;
         * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function&#13;
         *&#13;
         * @since       1.0.0&#13;
         * @access      public&#13;
         * @return      void&#13;
         */&#13;
        public function __construct( $field = array(), $value ='', $parent ) {&#13;
        &#13;
            parent::__construct( $parent-&gt;sections, $parent-&gt;args, $parent-&gt;extra_tabs );&#13;
&#13;
            $this-&gt;field = $field;&#13;
            $this-&gt;value = $value;&#13;
        &#13;
        }&#13;
&#13;
        /**&#13;
         * Field Render Function.&#13;
         *&#13;
         * Takes the vars and outputs the HTML for the field in the settings&#13;
         *&#13;
         * @since       1.0.0&#13;
         * @access      public&#13;
         * @return      void&#13;
         */&#13;
        public function render() {&#13;
    	&#13;
            $settings = array(&#13;
                'textarea_name' =&gt; $this-&gt;args['opt_name'] . '[' . $this-&gt;field['id'] . ']', &#13;
                'editor_class'  =&gt; $this-&gt;field['class'],&#13;
                'textarea_rows' =&gt; 8,&#13;
                'teeny' =&gt; false,&#13;
            );&#13;
&#13;
            wp_editor( $this-&gt;value, $this-&gt;field['id'], $settings );&#13;
&#13;
        }&#13;
&#13;
&#13;
        /**&#13;
         * Enqueue Function.&#13;
         *&#13;
         * If this field requires any scripts, or css define this function and register/enqueue the scripts/css&#13;
         *&#13;
         * @since       1.0.0&#13;
         * @access      public&#13;
         * @return      void&#13;
         */&#13;
        public function enqueue() {&#13;
&#13;
            wp_enqueue_style(&#13;
                'redux-field-editor-css', &#13;
                ReduxFramework::$_url . 'inc/fields/editor/field_editor.css',&#13;
                time(),&#13;
                true&#13;
            );&#13;
        &#13;
        }&#13;
&#13;
    }&#13;
}