Sha256: 46184986114e4e3b450c399adad46a633752405fb2787c48383e37236d7bb118

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

module DmCms::CmsPagesHelper

  #------------------------------------------------------------------------------
  def nested_tree(tree)  
    tree.map do |item, sub_items|
      render(:partial => 'tree', :locals => {:item => item, :sub_items => sub_items})
    end.join.html_safe  
  end

  #------------------------------------------------------------------------------
  def nested_tree_sidebar(tree)  
    tree.map do |item, sub_items|
      render(:partial => 'tree_sidebar', :locals => {:item => item, :sub_items => sub_items})
    end.join.html_safe  
  end
  
  # Return a list of templates defined in the theme.yml and it's parent theme.
  # The child templates should override any parent templates
  #------------------------------------------------------------------------------
  def template_menu_list
    theme = current_account.theme_data
    unless theme.empty?
      templates = (current_account.theme_data(parent: true)['templates'] || {}).merge(theme['templates'] || {})
      [['Inherit from parent', '']] + templates.collect {|key, value| [value['name'], key] }
    else
      nil
    end
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_cms-4.2.3.10 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.9 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.8 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.7 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.6 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.5 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.4 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.3 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.2 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3.1 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.3 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.2.3 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.2.2 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.2.1 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.2 app/helpers/dm_cms/cms_pages_helper.rb
dm_cms-4.2.1.5 app/helpers/dm_cms/cms_pages_helper.rb