public function addBodyStyles($styleNames, core_kernel_classes_Resource $itemResource, $langCode = ''){
        $itemContent = $this->getItemContent($itemResource, $langCode);
        if(!is_null($itemContent) && !empty($styleNames)){
            $classAttr = (string) $itemContent->itemBody['class'];
            foreach($styleNames as $styleName){
                if(!empty($styleName) && preg_match(self::STYLE_NAME_PATTERN, $styleName)){
                    $newClass = 'x-tao-style-'.$styleName;
                    if(strpos($classAttr, $styleName) === false){
                        $classAttr .= ' '.$newClass;
                    }
                }else{
                    throw new \common_Exception('invalid style name');
                }
            }
            $itemContent->itemBody['class'] = trim($classAttr);
            return $this->setItemContent($itemContent, $itemResource);
        }
        return false;
    }
public function addBodyStyles($styleNames, core_kernel_classes_Resource $itemResource, $langCode = ''){
        $itemContent = $this->getItemContent($itemResource, $langCode);
        if(!is_null($itemContent) && !empty($styleNames)){
            $classAttr = (string) $itemContent->itemBody['class'];
            foreach($styleNames as $styleName){
                if(!empty($styleName) && preg_match(self::STYLE_NAME_PATTERN, $styleName)){
                    $newClass = 'x-tao-style-'.$styleName;
                    if(strpos($classAttr, $styleName) === false){
                        $classAttr .= ' '.$newClass;
                    }
                }else{
                    throw new \common_Exception('invalid style name');
                }
            }
            $itemContent->itemBody['class'] = trim($classAttr);
            return $this->setItemContent($itemContent, $itemResource);
        }
        return false;
    }
public function addBodyStyles ( $ styleNames , core_kernel_classes_Resource $ itemResource , $ langCode = '' ) { $ itemContent = $ this -> getItemContent ( $ itemResource , $ langCode ) ; if ( ! is_null ( $ itemContent ) && ! empty ( $ styleNames ) ) { $ classAttr = ( string ) $ itemContent -> itemBody [ 'class' ] ; foreach ( $ styleNames as $ styleName ) { if ( ! empty ( $ styleName ) && preg_match ( self :: STYLE_NAME_PATTERN , $ styleName ) ) { $ newClass = 'x-tao-style-' . $ styleName ; if ( strpos ( $ classAttr , $ styleName ) === false ) { $ classAttr .= ' ' . $ newClass ; } } else { throw new \ common_Exception ( 'invalid style name' ) ; } } $ itemContent -> itemBody [ 'class' ] = trim ( $ classAttr ) ; return $ this -> setItemContent ( $ itemContent , $ itemResource ) ; } return false ; }
Add an array of body style classes to the itemBody of a qti item

@param core_kernel_classes_Resource $itemResource
@param string $langCode
@return boolean
@throws \common_Exception
Add an array of body style classes to the itemBody of a qti item