MOON
Server: Apache
System: Linux server.netcommlabs.in 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64
User: dermova (1051)
PHP: 5.4.45
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/dermova/public_html/india/wp-content/plugins/wr-megamenu/includes/helpers/html/items-list.php
<?php
/**
 * @version    $Id$
 * @package    WR MegaMenu
 * @author     WooRockets Team <support@woorockets.com>
 * @copyright  Copyright (C) 2014 WooRockets.com All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.woorockets.com
 * Technical Support:  Feedback - http://www.woorockets.com
 */

class WR_Megamenu_Helpers_Html_Items_List extends WR_Megamenu_Helpers_Html {
	/**
	 * List of other option types ( checkbox, select... )
	 * @param type $element
	 * @return type
	 */
	static function render( $element ) {
		$element = parent::get_extra_info( $element );
		$label   = parent::get_label( $element );

		$options_type = isset( $element['options_type'] ) ? $element['options_type'] : '';
		$ul_wrap = isset( $element['ul_wrap'] ) ? $element['ul_wrap'] : true;
		$output  = '';
		$element_clone = $element;
		$element_clone['wrapper_item_start'] = "<li class='jsn-item jsn-iconbar-trigger'>";
		$element_clone['wrapper_item_end']   = '</li>';
		$element_clone['blank_output'] = '1';
		$element['class'] = str_replace( 'form-control', '', $element['class'] );
		$element_clone['class'] = ( isset($element['class'] ) ? $element['class'] : '' ) . ' ' . $options_type;

		// re-arrange $element['options'] array by the order of value in $element['std']
		$element_clone['std'] = str_replace( ',', '__#__', $element_clone['std'] );
		if ( ! isset( $element_clone['no_order'] ) ) {
			$std_val = explode( '__#__', $element_clone['std'] );
			$std     = array();
			foreach ( $std_val as $value ) {
				if ( trim( $value ) != '' && isset ( $element_clone['options'][$value] ) )
					$std[$value] = $element_clone['options'][$value];
			}
			// other option value which is not defined in std
			foreach ( $element_clone['options'] as $key => $value ) {
				if ( ! in_array( $key, $std_val ) )
					$std[$key] = $value;
			}
			$element_clone['options'] = $std;
		}

		$output = WR_Megamenu_Helpers_Shortcode::render_parameter( $options_type, $element_clone );
		$output = $ul_wrap ? "<ul class='jsn-items-list ui-sortable'>$output</ul>" : $output;
		return parent::final_element( $element, $output, $label );
	}
}