Sindbad~EG File Manager

Current Path : /var/www/web3/encuestasupua/application/extensions/admin/TextDisplaySwitch/
Upload File :
Current File : /var/www/web3/encuestasupua/application/extensions/admin/TextDisplaySwitch/TextDisplaySwitch.php

<?php
class TextDisplaySwitch extends CWidget {
    
    public $widgetsJsName = "";
    public $textToDisplay = "";
    public $abbreviationSize = 120;
    public $abbreviationSign = '...';
    public $returnHtml = false;

    public function run() {
        //clean up the widgets name to be js friendly
        $this->widgetsJsName = preg_replace('/[^a-zA-Z0-9_-]/','',(string) $this->widgetsJsName);
        
        $this->registerScripts();
        $outView = (strlen((string) $this->textToDisplay) > $this->abbreviationSize) ? 'default' : 'short';
        
        if( $this->returnHtml ){
            return $this->render($outView, null, true);
        }

        $this->render($outView);

    }

    private function registerScripts(){
        App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(dirname(__FILE__) . '/assets/textDisplaySwitch.js'), CClientScript::POS_END);
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists