Classes

File phpboost/theme/ColumnsDisabled.class.php

File phpboost/theme/ColumnsDisabled.class.php

  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 
<?php
/**
 * @package     PHPBoost
 * @subpackage  Theme
 * @copyright   &copy; 2005-2019 PHPBoost
 * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0
 * @author      Kevin MASSY <reidlos@phpboost.com>
 * @version     PHPBoost 5.2 - last update: 2016 10 24
 * @since       PHPBoost 3.0 - 2011 04 10
 * @contributor Julien BRISWALTER <j1.seth@phpboost.com>
 * @contributor Arnaud GENET <elenwii@phpboost.com>
*/

class ColumnsDisabled
{
    private $disable_header = false;
    private $disable_sub_header = false;
    private $disable_top_central = false;
    private $disable_bottom_central = false;
    private $disable_top_footer = false;
    private $disable_footer = false;
    private $disable_left_columns = false;
    private $disable_right_columns = false;

    public function header_is_disabled()
    {
        return $this->disable_header;
    }

    public function sub_header_is_disabled()
    {
        return $this->disable_sub_header;
    }

    public function top_central_is_disabled()
    {
        return $this->disable_top_central;
    }

    public function bottom_central_is_disabled()
    {
        return $this->disable_bottom_central;
    }

    public function top_footer_is_disabled()
    {
        return $this->disable_top_footer;
    }

    public function footer_is_disabled()
    {
        return $this->disable_footer;
    }

    public function left_columns_is_disabled()
    {
        return $this->disable_left_columns;
    }

    public function right_columns_is_disabled()
    {
        return $this->disable_right_columns;
    }

    public function set_disable_header($disable)
    {
        $this->disable_header = $disable;
    }

    public function set_disable_sub_header($disable)
    {
        $this->disable_sub_header = $disable;
    }

    public function set_disable_top_central($disable)
    {
        $this->disable_top_central = $disable;
    }

    public function set_disable_bottom_central($disable)
    {
        $this->disable_bottom_central = $disable;
    }

    public function set_disable_top_footer($disable)
    {
        $this->disable_top_footer = $disable;
    }

    public function set_disable_footer($disable)
    {
        $this->disable_footer = $disable;
    }

    public function set_disable_left_columns($disable)
    {
        $this->disable_left_columns = $disable;
    }

    public function set_disable_right_columns($disable)
    {
        $this->disable_right_columns = $disable;
    }

    public function set_columns_disabled(Array $disable_columns)
    {
        foreach($disable_columns as $columns)
        {
            $attribute = trim(TextHelper::strtolower($columns));
            switch ($columns)
            {
                case 'header':
                    $this->disable_header = true;
                    unset($disable_columns['header']);
                    break;
                case 'sub_header':
                    $this->disable_sub_header = true;
                    unset($disable_columns['sub_header']);
                    break;
                case 'top_central':
                    $this->disable_top_central = true;
                    unset($disable_columns['top_central']);
                    break;
                case 'bottom_central':
                    $this->disable_bottom_central = true;
                    unset($disable_columns['bottom_central']);
                    break;
                case 'top_footer':
                    $this->disable_top_footer = true;
                    unset($disable_columns['top_footer']);
                    break;
                case 'footer':
                    $this->disable_footer = true;
                    unset($disable_columns['footer']);
                    break;
                case 'left':
                    $this->disable_left_columns = true;
                    unset($disable_columns['left']);
                    break;
                case 'right':
                    $this->disable_right_columns = true;
                    unset($disable_columns['right']);
                    break;
            }
        }
    }

    public function menus_column_is_disabled($column)
    {
        switch ($column)
        {
            case Menu::BLOCK_POSITION__HEADER:
                return $this->disable_header;
                break;
            case Menu::BLOCK_POSITION__SUB_HEADER:
                return $this->disable_sub_header;
                break;
            case Menu::BLOCK_POSITION__TOP_CENTRAL:
                return $this->disable_top_central;
                break;
            case Menu::BLOCK_POSITION__BOTTOM_CENTRAL:
                return $this->disable_bottom_central;
                break;
            case Menu::BLOCK_POSITION__TOP_FOOTER:
                return $this->disable_top_footer;
                break;
            case Menu::BLOCK_POSITION__FOOTER:
                return $this->disable_footer;
                break;
            case Menu::BLOCK_POSITION__LEFT:
                return $this->disable_left_columns;
                break;
            case Menu::BLOCK_POSITION__RIGHT:
                return $this->disable_right_columns;
                break;
        }
        return false;
    }
}
?>
Annonces