<?php

namespace GriffinForms\Admin\Choices;

use \GriffinForms\Traits\Singleton;

class format extends \GriffinForms\Admin\Format
{
    use Singleton;
    
    protected $lang;
    
    public function getChoices($for, $with_translation = true)
    {
        $this->setLang();
        $method = 'get' . $this->purgeString($for);
        if(method_exists($this, $method)) {
            $options = array();
            $raw_options = $this->$method();
            
            if ($with_translation === true) {
                foreach($raw_options as $option) {
                    $options[strtolower($option)] = $this->lang->getText($option);
                }
            } else {
                $options = $raw_options;
            }
            
            return $options;
        }
    }
    
    public function getListColumns()
    {
        $columns = array(
            'name',
            'description',
            'name_description',
            'heading',
            'heading_description',
            'author',
            'created_on',
            'author_created_on',
            'last_editor',
            'last_edited',
            'last_editor_edited'
        );
        return $columns;
    }    
    
    public function getOrderBy()
    {
        $columns = array(
            'id',
            'name',
            'description',
            'name_description',
            'heading',
            'heading_description',
            'author',
            'created_on',
            'author_created_on',
            'last_editor',
            'last_edited',
            'last_editor_edited'
        );
        return $columns;
    }    
    
    public function getSortOrder()
    {
        $sort = array(
            'asc',
            'desc'
        );
        return $sort;
    }
    
    public function getAlignment()
    {
        $options = array('left', 'middle', 'right');
        return $options;
    }    
    
    public function getFontWeight()
    {
        $options = array('bolder', 'bold', 'normal', 'light', 'lighter');
        return $options;
    }    
    
    public function getFontStyle()
    {
        $options = array('italics', 'underline', 'both');
        return $options;
    }
}