/** * * Function used to generate output of the field * * @return HTML output of the field * **/ public function output() { // load and parse XML file. $json_data = $this->tpl->get_json('config', 'menus'); // $output = ''; // prepare parser object $parser = new DynamoWPFormParser($this->tpl); // iterate through all menus in the file foreach ($json_data as $menu) { $temp_json = '[ { "groupname": "' . $menu->name . '", "groupdesc": "' . $menu->description . '", "fields": [ { "name": "navigation_menu_state_' . $menu->location . '", "type": "Select", "label": "' . __('Enable', DPTPLNAME) . ' ' . $menu->name . '", "tooltip": "' . __('You can enable or disable showing the menu in the template.', DPTPLNAME) . '", "default": "Y", "other": { "options": { "Y": "' . __('Enabled', DPTPLNAME) . '", "N": "' . __('Disabled', DPTPLNAME) . '", "rule": "' . __('Conditional rule', DPTPLNAME) . '" } } }, { "name": "navigation_menu_staterule_' . $menu->location . '", "type": "Text", "label": "' . __('Conditional rule', DPTPLNAME) . '", "tooltip": "' . __('You can enable showing the menu in the specific pages.', DPTPLNAME) . '", "default": "", "class": "", "visibility": "navigation_menu_state_' . $menu->location . '=rule" }, { "name": "navigation_menu_depth_' . $menu->location . '", "type": "Select", "label": "' . __('Depth of ', DPTPLNAME) . ' ' . $menu->name . '", "tooltip": "' . __('You can specify the menu depth.', DPTPLNAME) . '", "default": "0", "other": { "options": { "0": "' . __('All levels', DPTPLNAME) . '", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5" } } } ] } ]'; // parse the generated JSON $output .= $parser->generateForm($temp_json, true); } return $output; }
<?php // disable direct access to the file defined('DYNAMO_WP') or die('Access denied'); // access to the template object global $dynamo_tpl; // load the form parser include_once dynamo_file('dynamo_framework/form.parser.php'); // create a new instance of the form parser $parser = new DynamoWPFormParser($dynamo_tpl); // get the tabs list from the JSON file $tabs = $dynamo_tpl->get_json('options', 'tabs'); // iterators $tabsIterator = 0; $contentIterator = 0; // active tab $activeTab = 0; if (isset($_COOKIE[DPTPLNAME . '_active_tab']) && is_numeric($_COOKIE[DPTPLNAME . '_active_tab'])) { $activeTab = floor($_COOKIE[DPTPLNAME . '_active_tab']); } ?> <div class="dpWrap" id="dpMainWrap" data-theme="<?php echo DPTPLNAME; ?> "> <h1> <big><?php if (get_option($dynamo_tpl->name . "_branding_admin_page_template_name") != '') { echo get_option($dynamo_tpl->name . "_branding_admin_page_template_name"); } else {