Sha256: bfd8c1eb0c3ff99b04c27082f1d74ed9c60dae08a1ce41c8284731011ab0b4ec

Contents?: true

Size: 970 Bytes

Versions: 3

Compression:

Stored size: 970 Bytes

Contents

module LatoView
  # This module contain functions used to manage themes.
  module Interface::Themes

    # This function return the name of the current theme used for the
    # application.
    def view_getCurrentTemplateName
      return VIEW_CURRENTTEMPLATENAME if defined? VIEW_CURRENTTEMPLATENAME
      directory = core_getCacheDirectory
      if File.exist? "#{directory}/view.yml"
        # accedo al view.yml
        config = YAML.load(
          File.read(File.expand_path("#{directory}/view.yml", __FILE__))
        )
        # verifico esistenza dati
        if !config || !config['template']
          return false
        end
        # verifico che il template sia valido
        unless VIEW_TEMPLATES.include? config['template']
          raise 'Template value is not correct on view.yml config file' and return false
        end
        # ritorno nome template
        return config['template']
      else
        return false
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lato_view-1.1.5 lib/lato_view/interface/themes.rb
lato_view-1.1.4 lib/lato_view/interface/themes.rb
lato_view-1.1.3 lib/lato_view/interface/themes.rb