create the a links with the given attributes
 Params:
 +menuOption+:: is the menu option record
512633
def menu_routing(menuOption) 

			# create a hash of the menu option id
			existingData = make_hash menuOption.custom_data

			# create generic variables
			home_id = Setting.get('home_page')	
			article_url = Setting.get('articles_slug')	
			category_url = Setting.get('category_slug')	
			tag_url = Setting.get('tag_slug')	
			
			# start the string by defining the target 
			atts = get_target(existingData['target'])
			p = Post.find_by_id(existingData['linkto'])
			blog = false

			if menuOption.data_type == 'page' && !p.blank?
				
				url = p.id == home_id.to_i ? site_url() : site_url(p.structured_url)
				atts += " href='#{url}' class='menu_link'"

			elsif menuOption.data_type == 'article' && !p.blank?

				url = site_url(article_url +  p.structured_url)
				atts += " href='#{url}' class='menu_link'"

			elsif menuOption.data_type == 'category'

				t = Term.find(existingData['linkto'])
				url = site_url(article_url + '/' + category_url + t.structured_url)
				atts += " href='#{url}' class='menu_link'"

			elsif menuOption.data_type == 'tag'

				t = Term.find(existingData['linkto'])
				url = site_url(article_url + '/' + tag_url + t.structured_url)
				atts += " href='#{url}' class='menu_link'"

			elsif menuOption.data_type == article_url && menuOption.option_id == 0 

				url = site_url(article_url)
				atts += " href='#{url}' class='menu_link'"
				blog = true

			elsif menuOption.data_type == 'custom'

				url = existingData['customlink']
				atts += " href='#{url}' class='menu_link'"

			end

			atts = (atts[0..-2] + " #{existingData['class']}'") if !existingData['class'].blank?

			if blog && request.original_url.include?(url)
				atts = (atts[0..-2] + " active'") 	
			else
				atts = (atts[0..-2] + " active'") if url == request.original_url
			end


			atts

		end
366602
def _append(self, menu):
        ''''''
        menu.AppendCheckItem(self.id(), self.name, self.description)
        menu.Check(self.id(), self.checked)
829861
def _create_and_add_option(option):
    '''
    
    '''
    global _current_option

    _current_option = Option()
    type_, params = _expand_one_key_dictionary(option)
    _current_option.type = type_
    _create_and_add_parameters(params)
    _current_statement.add_child(_current_option)
589303
def create
      @menu = Menu.new(menu_params)

      respond_to do |format|

        if @menu.save
          format.html { redirect_to edit_admin_menu_path(@menu), notice: I18n.t("controllers.admin.menus.create.flash.success")}
        else
          format.html {
            @all_menus = Menu.all
            render action: "index"
          }
        end

      end
    end
110986
def linked_to_for(name, predicate, options)
      Tripod::Links::LinkedTo.new(name, predicate, options)
    end
697394
public function create()
    {
        // Keep default options in an array and merge with incoming options that can override the defaults.
        $default = array(
            'id'          => null,
            'class'       => null,
            'wrapper'     => 'nav',
            'create_url'  => function ($url) {
                return $url;
            },
        );
        $menu = array_replace_recursive($default, $this->config);

        // Create the ul li menu from the array, use an anonomous recursive function that returns an
        // array of values.
        $createMenu = function ($items, $callback) use (&$createMenu, $menu) {
            
            $html = null;
            $hasItemIsSelected = false;

            foreach ($items as $item) {

                // has submenu, call recursivly and keep track on if the submenu has a selected item in it.
                $submenu        = null;
                $selectedParent = null;
            
                if (isset($item['submenu'])) {
                    list($submenu, $selectedParent) = $createMenu($item['submenu']['items'], $callback);
                    $selectedParent = $selectedParent
                        ? "selected-parent "
                        : null;
                }

                // Check if the current menuitem is selected
                $selected = $callback($item['url'])
                    ? "selected "
                    : null;
                
                // Check if the menuitem is a parent of current page, /controller for /controller/action
                $isParent = null;
                if (isset($item['mark-if-parent-of']) && $item['mark-if-parent-of'] == true) {
                    $isParent = $menu['is_parent']($item['mark-if-parent-of'])
                        ? "is-parent "
                        : null;
                }
                
                // Is there a class set for this item, then use it
                $class = isset($item['class']) && ! is_null($item['class'])
                    ? $item['class']
                    : null;

                // Prepare the class-attribute, if used
                $class = ($selected || $selectedParent || $isParent || $class)
                    ? " class='{$selected}{$selectedParent}{$isParent}{$class}' "
                    : null;

                // Add the menu item
                $url = $menu['create_url']($item['url']);
                $html .= "\n<li{$class}><a href='{$url}' title='{$item['title']}'>{$item['text']}</a>{$submenu}</li>\n";
                
                // To remember there is selected children when going up the menu hierarchy
                if ($selected) {
                    $hasItemIsSelected = true;
                }
            }

            // Return the menu
            return array("\n<ul>$html</ul>\n", $hasItemIsSelected);
        };

        // Call the anonomous function to create the menu, and submenues if any.
        list($html) = $createMenu($menu['items'], $menu['callback']);


        // Set the id & class element, only if it exists in the menu-array
        $id      = isset($menu['id'])    ? " id='{$menu['id']}'"       : null;
        $class   = isset($menu['class']) ? " class='{$menu['class']}'" : null;
        $wrapper = $menu['wrapper'];

        return "\n<{$wrapper}{$id}{$class}>{$html}</{$wrapper}>\n";
    }
611443
public Link createLink(String name, String url, boolean onMenu) {
        return getInstance().create().link(name, this, url, onMenu);
    }
303732
def option(name, type = nil, **opts, &block)
      add_definition(true, name, type, block, opts)
    end
936756
def build_params_for(param_type)
      return {} if @request.operations.empty?

      keys = %i(attributes to_one to_many)
      operation = @request.operations.find { |e| e.options[:data].keys & keys == keys }

      if operation.nil?
        {}
      elsif param_type == :relationship
        operation.options[:data].values_at(:to_one, :to_many).compact.reduce(&:merge)
      else
        operation.options[:data][:attributes]
      end
    end
214247
function appendAttrs(action, attrs, _updates, opts) {
  var updates = isTypeUpdates(this) ? this : (_updates || (new Updates()));

  if (attrs && hasKeysOnly(attrs)) {
    appendAttrsKeysOnly(action, attrs, updates, opts);
  } else if (typeof attrs === "object") {
    util.forIn(attrs, function(value, key) {
      if (value !== null && typeof value !== 'undefined')
        appendAttr(action, key, value, updates, opts);
    });
  }
  
  return updates;
}
634898
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.split( core_rspace ), function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
786002
def add_option(name, parameters)
      self.class.handle_warnings(name, **parameters.dup)
      chain_options.merge(name => parameters.merge(method_hash(parameters)))
    end
718984
def create_params params
      options = {}
      options[:query] = params

      if @auth_token
        options[:query].merge!(auth_token: @auth_token)
      else
        options[:basic_auth] = @auth
      end

      options
    end
213222
public static function link($menu, $text, array $options = [], array $fields = [])
    {
        if ($menu instanceof ActiveRecord) {

            if (!$fields) {
                $fields = self::$fields;
            }

            if ($menu->{$fields['page_blank']}) {
                $options['target'] = '_blank';
            }

            return Html::a($text, self::linkUrl(
                $menu->{$fields['page_id']},
                $menu->{$fields['page_url']}
            ), $options);
        }

        return false;
    }
543065
def add_options(options = {}, raw_options = nil)
      @options.merge!(options.stringify_keys) unless options.blank?
      @raw_options << raw_options unless raw_options.blank?
    end
940893
function initMenu() {
    let menuCfg = defaults.menu;

    // no configuration given and neither the menu created earlier
    // no need to proceed
    if (!menuCfg && !Menu.created) {
        return;
    }

    // set options to create menu
    if (menuCfg) {
        Menu.setOptions(menuCfg);
    }

    menuDoc = Menu.get();
    Page.prepareDom(menuDoc);
}
897553
def create_option(flag, argument = nil)
      return '' unless flag
      flag = flag.to_s
      return " #{argument}" if flag == 'extra'
      set_pandoc_ruby_options(flag, argument)
      if !argument.nil?
        "#{format_flag(flag)} #{argument}"
      else
        format_flag(flag)
      end
    end