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/www/india/wp-content/plugins/wr-megamenu/includes/helpers/builder.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_Builder
{
	/**
	 * Generate megamenu page header
	 * @param string $header_str
	 */
	public function generate_header( $header_str = 'WR MegaMenu Builder', $icon_class = '' )
	{
		$header  = '<div clas"icon32 ' . $icon_class . '"></div>';
		$header .= '<h2>' . $header_str . '</h2>';
		return $header;
	}

	/**
	 * Get MegaMenu data (setting, information) by Menu and Location
	 * @param int $profile_id
	 * @param int $menu_id
	 * @return array
	 */
	public static function get_megamenu_data( $profile_id, $menu_id = null )
	{
		$data     = get_post_meta( $profile_id, WR_MEGAMENU_META_KEY, true );
		$settings = (array)json_decode( $data, true );

		if (  count( $settings ) ) {
			$menu_settings = @$settings['settings'];

			if ( $menu_id ) {
				if ( isset( $menu_settings[ $menu_id ] ) ) {
					return (array)$menu_settings[ $menu_id ];
				} else {
					return array();
				}
			} else {
				return $settings;
			}
		}

		return array();
	}


	/**
	 *	Parse the widget the setting string to array
	 * @param string $options_str sample: widget-recent-comments%5B0%5D%5Btitle%5D=WidgetTitle&widget-recent-comments%5B0%5D%5Bnumber%5D=5
	 */
	public static function parse_menu_widget_options( $options_str )
	{
		parse_str( urldecode( $options_str ), $options );
		return $options;
	}

}