- Posts: 57
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
public function answersAsReadonlyAddScript() { /* Quit if is done */ if(array_key_exists(get_class($this),Yii::app()->getClientScript()->packages)) { return; } /* Add package if not exist (allow to use another one in config) */ if(!Yii::app()->clientScript->hasPackage(get_class($this))) { Yii::setPathOfAlias(get_class($this),dirname(__FILE__)); Yii::app()->clientScript->addPackage(get_class($this), array( 'basePath' => get_class($this).'.assets', 'css' => array(get_class($this).'.css'), 'js' => array(get_class($this).'.js'), 'depends' =>array('limesurvey-public'), )); } /* Registering the package */ Yii::app()->getClientScript()->registerPackage(get_class($this)); }
if(array_key_exists(get_class($this),Yii::app()->getClientScript()->packages)) { if(!Yii::app()->clientScript->hasPackage(get_class($this))) {
public function answersAsReadonlyAddScript() { if(!Yii::app()->clientScript->hasPackage(get_class($this))) { Yii::setPathOfAlias(get_class($this),dirname(__FILE__)); Yii::app()->clientScript->addPackage(get_class($this), array( 'basePath' => get_class($this).'.assets', 'css' => array(get_class($this).'.css'), 'js' => array(get_class($this).'.js'), 'depends' =>array('limesurvey-public'), )); Yii::app()->getClientScript()->registerPackage(get_class($this)); } }
public function answersAsReadonlyAddScript() { if(!Yii::app()->clientScript->hasPackage(get_class($this))) { Yii::setPathOfAlias(get_class($this),dirname(__FILE__)); Yii::app()->clientScript->addPackage(get_class($this), array( 'basePath' => get_class($this).'.assets', 'css' => array(get_class($this).'.css'), 'js' => array(get_class($this).'.js'), 'depends' =>array('limesurvey-public'), )); } Yii::app()->getClientScript()->registerPackage(get_class($this)); }