AnonSec Team
Server IP : 127.0.0.1  /  Your IP : 127.0.0.1
Web Server : Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3
System : Windows NT WIN-R7LTCC7BPLI 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586
User : GerbangSIPAD ( 0)
PHP Version : 5.6.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF
Directory (0777) :  C:/xampp5/htdocs/ppat_online_kolaka/_protected/helpers/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : C:/xampp5/htdocs/ppat_online_kolaka/_protected/helpers/CssHelper.php
<?php
namespace app\helpers;

use Yii;

/**
 * Css helper class.
 */
class CssHelper
{
    /**
     * Returns the appropriate css class based on the value of user $status.
     * NOTE: used in user/index view.
     *
     * @param  string $status User status.
     * @return string         Css class.
     */
    public static function statusCss($status)
    {
        if ($status === Yii::t('app', 'Active'))
        {
            return "boolean-true";
        } 
        else 
        {
            return "boolean-false";
        }      
    }

    /**
     * Returns the appropriate css class based on the value of role $item_name.
     * NOTE: used in user/index view.
     *
     * @param  string $role Role name.
     * @return string       Css class.
     */
    public static function roleCss($role)
    {
        return "role-".$role."";    
    }

    /**
     * Returns the appropriate css class based on the value of Article $status.
     * NOTE: used in article/admin view.
     *
     * @param  string $status Article status.
     * @return string         Css class.
     */
    public static function articleStatusCss($status)
    {
        if ($status === Yii::t('app', 'Published'))
        {
            return "boolean-true";
        } 
        else 
        {
            return "boolean-false";
        }      
    }  

    /**
     * Returns the appropriate css class based on the value of Article $category.
     * NOTE: used in article/admin view.
     *
     * @param  string $category Article category.
     * @return string           Css class.
     */
    public static function articleCategoryCss($category)
    {
        if ($category === Yii::t('app', 'Economy'))
        {
            return "blue";
        }
        elseif ($category === Yii::t('app', 'Sport')) 
        {
            return "green";
        }
        else 
        {
            return "gold";
        }      
    }   
}

AnonSec - 2021