idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
53,100 | public static function controlGroup ( $ type , $ name , $ value = '' , $ htmlOptions = array ( ) , $ data = array ( ) ) { $ color = TbArray :: popValue ( 'color' , $ htmlOptions ) ; $ groupOptions = TbArray :: popValue ( 'groupOptions' , $ htmlOptions , array ( ) ) ; $ controlOptions = TbArray :: popValue ( 'controlOpt... | Generates a form control group . |
53,101 | public static function createInput ( $ type , $ name , $ value , $ htmlOptions = array ( ) , $ data = array ( ) ) { switch ( $ type ) { case self :: INPUT_TYPE_TEXT : return self :: textField ( $ name , $ value , $ htmlOptions ) ; case self :: INPUT_TYPE_PASSWORD : return self :: passwordField ( $ name , $ value , $ ht... | Creates a form input of the given type . |
53,102 | protected static function createCheckBoxAndRadioButtonLabel ( $ label , $ input , $ htmlOptions ) { list ( $ hidden , $ input ) = self :: normalizeCheckBoxAndRadio ( $ input ) ; return $ hidden . ( $ label !== false ? self :: tag ( 'label' , $ htmlOptions , $ input . ' ' . $ label ) : $ input ) ; } | Generates a label for a checkbox or radio input by wrapping the input . |
53,103 | protected static function normalizeCheckBoxAndRadio ( $ input ) { $ parts = preg_split ( "/(<.*?>)/" , $ input , 2 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ) ; if ( isset ( $ parts [ 1 ] ) ) { return $ parts ; } else { return array ( '' , $ parts [ 0 ] ) ; } } | Normalizes the inputs in the given string by splitting them up into an array . |
53,104 | public static function activeInlineRadioButtonList ( $ model , $ attribute , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: activeRadioButtonList ( $ model , $ attribute , $ data , $ htmlOptions ) ; } | Generates an inline radio button list for a model attribute . |
53,105 | public static function activeInlineCheckBoxList ( $ model , $ attribute , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: activeCheckBoxList ( $ model , $ attribute , $ data , $ htmlOptions ) ; } | Generates an inline check box list for a model attribute . |
53,106 | public static function activeUneditableField ( $ model , $ attribute , $ htmlOptions = array ( ) ) { parent :: resolveNameID ( $ model , $ attribute , $ htmlOptions ) ; $ value = parent :: resolveValue ( $ model , $ attribute ) ; TbArray :: removeValues ( array ( 'name' , 'id' ) , $ htmlOptions ) ; return self :: unedi... | Generates an uneditable input for a model attribute . |
53,107 | public static function activeSearchQueryField ( $ model , $ attribute , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'search-query' , $ htmlOptions ) ; return self :: activeTextField ( $ model , $ attribute , $ htmlOptions ) ; } | Generates a search query input for a model attribute . |
53,108 | public static function activeUrlFieldControlGroup ( $ model , $ attribute , $ htmlOptions = array ( ) ) { return self :: activeControlGroup ( self :: INPUT_TYPE_URL , $ model , $ attribute , $ htmlOptions ) ; } | Generates a control group with a url field for a model attribute . |
53,109 | public static function activeEmailFieldControlGroup ( $ model , $ attribute , $ htmlOptions = array ( ) ) { return self :: activeControlGroup ( self :: INPUT_TYPE_EMAIL , $ model , $ attribute , $ htmlOptions ) ; } | Generates a control group with a email field for a model attribute . |
53,110 | public static function activeUneditableFieldControlGroup ( $ model , $ attribute , $ htmlOptions = array ( ) ) { return self :: activeControlGroup ( self :: INPUT_TYPE_UNEDITABLE , $ model , $ attribute , $ htmlOptions ) ; } | Generates a control group with a uneditable field for a model attribute . |
53,111 | public static function activeControlGroup ( $ type , $ model , $ attribute , $ htmlOptions = array ( ) , $ data = array ( ) ) { $ color = TbArray :: popValue ( 'color' , $ htmlOptions ) ; $ groupOptions = TbArray :: popValue ( 'groupOptions' , $ htmlOptions , array ( ) ) ; $ controlOptions = TbArray :: popValue ( 'cont... | Generates an active form row . |
53,112 | public static function createActiveInput ( $ type , $ model , $ attribute , $ htmlOptions = array ( ) , $ data = array ( ) ) { switch ( $ type ) { case self :: INPUT_TYPE_TEXT : return self :: activeTextField ( $ model , $ attribute , $ htmlOptions ) ; case self :: INPUT_TYPE_PASSWORD : return self :: activePasswordFie... | Creates an active form input of the given type . |
53,113 | protected static function normalizeInputOptions ( $ options ) { self :: addSpanClass ( $ options ) ; self :: addTextAlignClass ( $ options ) ; $ size = TbArray :: popValue ( 'size' , $ options ) ; if ( TbArray :: popValue ( 'block' , $ options , false ) ) { self :: addCssClass ( 'input-block-level' , $ options ) ; } el... | Normalizes input options . |
53,114 | public static function formActions ( $ actions , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'form-actions' , $ htmlOptions ) ; if ( is_array ( $ actions ) ) { $ actions = implode ( ' ' , $ actions ) ; } return self :: tag ( 'div' , $ htmlOptions , $ actions ) ; } | Generates form actions . |
53,115 | public static function searchForm ( $ action , $ method = 'post' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'form-search' , $ htmlOptions ) ; $ inputOptions = TbArray :: popValue ( 'inputOptions' , $ htmlOptions , array ( ) ) ; $ inputOptions = TbArray :: merge ( array ( 'type' => 'text' , 'placeholder' => '... | Generates a search form . |
53,116 | public static function ajaxButton ( $ label , $ url , $ ajaxOptions = array ( ) , $ htmlOptions = array ( ) ) { $ ajaxOptions [ 'url' ] = $ url ; $ htmlOptions [ 'ajaxOptions' ] = $ ajaxOptions ; return self :: btn ( self :: BUTTON_TYPE_AJAXBUTTON , $ label , $ htmlOptions ) ; } | Generates a push button that can initiate AJAX requests . |
53,117 | protected static function createButton ( $ type , $ label , $ htmlOptions ) { $ url = TbArray :: popValue ( 'url' , $ htmlOptions , '#' ) ; $ ajaxOptions = TbArray :: popValue ( 'ajaxOptions' , $ htmlOptions , array ( ) ) ; switch ( $ type ) { case self :: BUTTON_TYPE_HTML : return parent :: htmlButton ( $ label , $ ht... | Creates a button the of given type . |
53,118 | public static function imageRounded ( $ src , $ alt = '' , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'type' ] = self :: IMAGE_TYPE_ROUNDED ; return self :: image ( $ src , $ alt , $ htmlOptions ) ; } | Generates an image tag with rounded corners . |
53,119 | public static function imageCircle ( $ src , $ alt = '' , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'type' ] = self :: IMAGE_TYPE_CIRCLE ; return self :: image ( $ src , $ alt , $ htmlOptions ) ; } | Generates an image tag with circle . |
53,120 | public static function imagePolaroid ( $ src , $ alt = '' , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'type' ] = self :: IMAGE_TYPE_POLAROID ; return self :: image ( $ src , $ alt , $ htmlOptions ) ; } | Generates an image tag within polaroid frame . |
53,121 | protected static function dropdown ( $ items , $ htmlOptions = array ( ) ) { TbArray :: defaultValue ( 'role' , 'menu' , $ htmlOptions ) ; self :: addCssClass ( 'dropdown-menu' , $ htmlOptions ) ; return self :: menu ( $ items , $ htmlOptions ) ; } | Generates a dropdown menu . |
53,122 | protected static function dropdownToggle ( $ type , $ label , $ htmlOptions ) { self :: addCssClass ( 'dropdown-toggle' , $ htmlOptions ) ; $ label .= ' <b class="caret"></b>' ; $ htmlOptions [ 'data-toggle' ] = 'dropdown' ; return self :: btn ( $ type , $ label , $ htmlOptions ) ; } | Generates a dropdown toggle element . |
53,123 | public static function dropdownToggleMenuLink ( $ label , $ url = '#' , $ htmlOptions = array ( ) , $ depth = 0 ) { self :: addCssClass ( 'dropdown-toggle' , $ htmlOptions ) ; if ( $ depth === 0 ) { $ label .= ' <b class="caret"></b>' ; } $ htmlOptions [ 'data-toggle' ] = 'dropdown' ; return self :: link ( $ label , $ ... | Generates a dropdown toggle menu item . |
53,124 | public static function buttonToolbar ( array $ groups , $ htmlOptions = array ( ) ) { if ( ! empty ( $ groups ) ) { self :: addCssClass ( 'btn-toolbar' , $ htmlOptions ) ; $ parentOptions = array ( 'color' => TbArray :: popValue ( 'color' , $ htmlOptions ) , 'size' => TbArray :: popValue ( 'size' , $ htmlOptions ) , 'd... | Generates a button toolbar . |
53,125 | public static function splitButtonDropdown ( $ label , $ items , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'split' ] = true ; return self :: buttonDropdown ( $ label , $ items , $ htmlOptions ) ; } | Generates a button with a split dropdown menu . |
53,126 | public static function navList ( $ items , $ htmlOptions = array ( ) ) { foreach ( $ items as $ i => $ itemOptions ) { if ( is_string ( $ itemOptions ) ) { continue ; } if ( ! isset ( $ itemOptions [ 'url' ] ) && ! isset ( $ itemOptions [ 'items' ] ) ) { $ label = TbArray :: popValue ( 'label' , $ itemOptions , '' ) ; ... | Generates a list navigation . |
53,127 | public static function nav ( $ type , $ items , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'nav' , $ htmlOptions ) ; if ( ! empty ( $ type ) ) { self :: addCssClass ( 'nav-' . $ type , $ htmlOptions ) ; } $ stacked = TbArray :: popValue ( 'stacked' , $ htmlOptions , false ) ; if ( $ type !== self :: NAV_TYPE_L... | Generates a navigation menu . |
53,128 | public static function menuLink ( $ label , $ url , $ htmlOptions = array ( ) ) { TbArray :: defaultValue ( 'role' , 'menuitem' , $ htmlOptions ) ; $ linkOptions = TbArray :: popValue ( 'linkOptions' , $ htmlOptions , array ( ) ) ; $ content = self :: link ( $ label , $ url , $ linkOptions ) ; return self :: tag ( 'li'... | Generates a menu link . |
53,129 | protected static function menuDropdown ( $ label , $ url , $ items , $ htmlOptions , $ depth = 0 ) { self :: addCssClass ( $ depth === 0 ? 'dropdown' : 'dropdown-submenu' , $ htmlOptions ) ; TbArray :: defaultValue ( 'role' , 'menuitem' , $ htmlOptions ) ; $ linkOptions = TbArray :: popValue ( 'linkOptions' , $ htmlOpt... | Generates a menu dropdown . |
53,130 | public static function tabbable ( $ type , $ tabs , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'tabbable' , $ htmlOptions ) ; $ placement = TbArray :: popValue ( 'placement' , $ htmlOptions ) ; if ( ! empty ( $ placement ) ) { self :: addCssClass ( 'tabs-' . $ placement , $ htmlOptions ) ; } $ menuOptions = Tb... | Generates a tabbable menu . |
53,131 | public static function navbarText ( $ text , $ htmlOptions = array ( ) , $ tag = 'p' ) { self :: addCssClass ( 'navbar-text' , $ htmlOptions ) ; return self :: tag ( $ tag , $ htmlOptions , $ text ) ; } | Generates a text for the navbar . |
53,132 | public static function navbarForm ( $ action , $ method = 'post' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'navbar-form' , $ htmlOptions ) ; return self :: form ( $ action , $ method , $ htmlOptions ) ; } | Generates a navbar form . |
53,133 | public static function navbarSearchForm ( $ action , $ method = 'post' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'navbar-search' , $ htmlOptions ) ; return self :: searchForm ( $ action , $ method , $ htmlOptions ) ; } | Generates a navbar search form . |
53,134 | public static function breadcrumbs ( $ links , $ htmlOptions = array ( ) ) { $ divider = TbArray :: popValue ( 'divider' , $ htmlOptions , '/' ) ; self :: addCssClass ( 'breadcrumb' , $ htmlOptions ) ; $ output = self :: openTag ( 'ul' , $ htmlOptions ) ; foreach ( $ links as $ label => $ url ) { if ( is_string ( $ lab... | Generates a breadcrumb menu . |
53,135 | public static function pagination ( array $ items , $ htmlOptions = array ( ) ) { if ( ! empty ( $ items ) ) { self :: addCssClass ( 'pagination' , $ htmlOptions ) ; $ size = TbArray :: popValue ( 'size' , $ htmlOptions ) ; if ( ! empty ( $ size ) ) { self :: addCssClass ( 'pagination-' . $ size , $ htmlOptions ) ; } $... | Generates a pagination . |
53,136 | public static function heroUnit ( $ heading , $ content , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'hero-unit' , $ htmlOptions ) ; $ headingOptions = TbArray :: popValue ( 'headingOptions' , $ htmlOptions , array ( ) ) ; $ output = self :: openTag ( 'div' , $ htmlOptions ) ; $ output .= self :: tag ( 'h1' , ... | Generates a hero unit . |
53,137 | public static function pageHeader ( $ heading , $ subtext , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'page-header' , $ htmlOptions ) ; $ headerOptions = TbArray :: popValue ( 'headerOptions' , $ htmlOptions , array ( ) ) ; $ subtextOptions = TbArray :: popValue ( 'subtextOptions' , $ htmlOptions , array ( ) ... | Generates a pager header . |
53,138 | public static function thumbnail ( $ content , $ htmlOptions = array ( ) ) { $ itemOptions = TbArray :: popValue ( 'itemOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'thumbnail' , $ htmlOptions ) ; $ output = self :: openTag ( 'li' , $ itemOptions ) ; $ output .= self :: tag ( 'div' , $ htmlOptions , $... | Generates a thumbnail . |
53,139 | public static function thumbnailLink ( $ content , $ url = '#' , $ htmlOptions = array ( ) ) { $ itemOptions = TbArray :: popValue ( 'itemOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'thumbnail' , $ htmlOptions ) ; $ content = self :: link ( $ content , $ url , $ htmlOptions ) ; return self :: tag ( '... | Generates a link thumbnail . |
53,140 | public static function alert ( $ color , $ message , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'alert' , $ htmlOptions ) ; if ( ! empty ( $ color ) ) { self :: addCssClass ( 'alert-' . $ color , $ htmlOptions ) ; } if ( TbArray :: popValue ( 'in' , $ htmlOptions , true ) ) { self :: addCssClass ( 'in' , $ htm... | Generates an alert . |
53,141 | public static function blockAlert ( $ color , $ message , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'block' ] = true ; return self :: alert ( $ color , $ message , $ htmlOptions ) ; } | Generates an alert block . |
53,142 | public static function stackedProgressBar ( array $ bars , $ htmlOptions = array ( ) ) { if ( ! empty ( $ bars ) ) { self :: addCssClass ( 'progress' , $ htmlOptions ) ; $ output = self :: openTag ( 'div' , $ htmlOptions ) ; $ totalWidth = 0 ; foreach ( $ bars as $ barOptions ) { if ( isset ( $ barOptions [ 'visible' ]... | Generates a stacked progress bar . |
53,143 | public static function mediaList ( array $ items , $ htmlOptions = array ( ) ) { if ( ! empty ( $ items ) ) { self :: addCssClass ( 'media-list' , $ htmlOptions ) ; $ output = '' ; $ output .= self :: openTag ( 'ul' , $ htmlOptions ) ; $ output .= self :: medias ( $ items , 'li' ) ; $ output .= '</ul>' ; return $ outpu... | Generates a list of media objects . |
53,144 | public static function medias ( array $ items , $ tag = 'div' ) { if ( ! empty ( $ items ) ) { $ output = '' ; foreach ( $ items as $ itemOptions ) { if ( isset ( $ itemOptions [ 'visible' ] ) && $ itemOptions [ 'visible' ] === false ) { continue ; } $ options = TbArray :: popValue ( 'htmlOptions' , $ itemOptions , arr... | Generates multiple media objects . |
53,145 | public static function media ( $ image , $ heading , $ content , $ htmlOptions = array ( ) ) { $ tag = TbArray :: popValue ( 'tag' , $ htmlOptions , 'div' ) ; self :: addCssClass ( 'media' , $ htmlOptions ) ; $ linkOptions = TbArray :: popValue ( 'linkOptions' , $ htmlOptions , array ( ) ) ; TbArray :: defaultValue ( '... | Generates a single media object . |
53,146 | public static function well ( $ content , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'well' , $ htmlOptions ) ; $ size = TbArray :: popValue ( 'size' , $ htmlOptions ) ; if ( ! empty ( $ size ) ) { self :: addCssClass ( 'well-' . $ size , $ htmlOptions ) ; } return self :: tag ( 'div' , $ htmlOptions , $ conte... | Generates a well element . |
53,147 | protected static function close ( $ tag , $ label , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'close' , $ htmlOptions ) ; $ dismiss = TbArray :: popValue ( 'dismiss' , $ htmlOptions ) ; if ( ! empty ( $ dismiss ) ) { $ htmlOptions [ 'data-dismiss' ] = $ dismiss ; } $ htmlOptions [ 'type' ] = 'button' ; return... | Generates a close element . |
53,148 | public static function collapseLink ( $ label , $ target , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'data-toggle' ] = 'collapse' ; return self :: link ( $ label , $ target , $ htmlOptions ) ; } | Generates a collapse link . |
53,149 | public static function modalBody ( $ content , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'modal-body' , $ htmlOptions ) ; return self :: tag ( 'div' , $ htmlOptions , $ content ) ; } | Generates a modal body . |
53,150 | public static function modalFooter ( $ content , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'modal-footer' , $ htmlOptions ) ; return self :: tag ( 'div' , $ htmlOptions , $ content ) ; } | Generates a modal footer . |
53,151 | public static function tooltip ( $ label , $ url , $ content , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'rel' ] = 'tooltip' ; return self :: tooltipPopover ( $ label , $ url , $ content , $ htmlOptions ) ; } | Generates a tooltip . |
53,152 | public static function popover ( $ label , $ title , $ content , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'rel' ] = 'popover' ; $ htmlOptions [ 'data-content' ] = $ content ; $ htmlOptions [ 'data-toggle' ] = 'popover' ; return self :: tooltipPopover ( $ label , '#' , $ title , $ htmlOptions ) ; } | Generates a popover . |
53,153 | protected static function tooltipPopover ( $ label , $ url , $ title , $ htmlOptions ) { $ htmlOptions [ 'title' ] = $ title ; if ( TbArray :: popValue ( 'animation' , $ htmlOptions ) ) { $ htmlOptions [ 'data-animation' ] = 'true' ; } if ( TbArray :: popValue ( 'html' , $ htmlOptions ) ) { $ htmlOptions [ 'data-html' ... | Generates a base tooltip . |
53,154 | public static function carouselItem ( $ content , $ label , $ caption , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'item' , $ htmlOptions ) ; $ overlayOptions = TbArray :: popValue ( 'overlayOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'carousel-caption' , $ overlayOptions ) ; $ labelOptions ... | Generates a carousel item . |
53,155 | public static function carouselPrevLink ( $ label , $ url = '#' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'carousel-control left' , $ htmlOptions ) ; $ htmlOptions [ 'data-slide' ] = 'prev' ; return self :: link ( $ label , $ url , $ htmlOptions ) ; } | Generates a previous link for the carousel . |
53,156 | public static function carouselNextLink ( $ label , $ url = '#' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'carousel-control right' , $ htmlOptions ) ; $ htmlOptions [ 'data-slide' ] = 'next' ; return self :: link ( $ label , $ url , $ htmlOptions ) ; } | Generates a next link for the carousel . |
53,157 | public static function carouselIndicators ( $ target , $ numSlides , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'carousel-indicators' , $ htmlOptions ) ; $ output = self :: openTag ( 'ol' , $ htmlOptions ) ; for ( $ i = 0 ; $ i < $ numSlides ; $ i ++ ) { $ itemOptions = array ( 'data-target' => $ target , 'dat... | Generates an indicator for the carousel . |
53,158 | public static function addCssClass ( $ className , & $ htmlOptions ) { if ( is_string ( $ className ) ) { $ className = explode ( ' ' , $ className ) ; } if ( isset ( $ htmlOptions [ 'class' ] ) ) { $ classes = array_filter ( explode ( ' ' , $ htmlOptions [ 'class' ] ) ) ; foreach ( $ className as $ class ) { $ class =... | Appends new class names to the given options .. |
53,159 | public static function addCssStyle ( $ style , & $ htmlOptions ) { if ( is_array ( $ style ) ) { $ style = implode ( '; ' , $ style ) ; } $ style = rtrim ( $ style , ';' ) ; $ htmlOptions [ 'style' ] = isset ( $ htmlOptions [ 'style' ] ) ? rtrim ( $ htmlOptions [ 'style' ] , ';' ) . '; ' . $ style : $ style ; } | Appends a CSS style string to the given options . |
53,160 | protected static function addPullClass ( & $ htmlOptions ) { $ pull = TbArray :: popValue ( 'pull' , $ htmlOptions ) ; if ( ! empty ( $ pull ) ) { self :: addCssClass ( 'pull-' . $ pull , $ htmlOptions ) ; } } | Adds the pull class to the given options is applicable . |
53,161 | protected static function addTextAlignClass ( & $ htmlOptions ) { $ align = TbArray :: popValue ( 'textAlign' , $ htmlOptions ) ; if ( ! empty ( $ align ) ) { self :: addCssClass ( 'text-' . $ align , $ htmlOptions ) ; } } | Adds the text align class to the given options if applicable . |
53,162 | protected function registerCssPackagesIfEnabled ( ) { if ( ! $ this -> coreCss ) return ; if ( ! $ this -> ajaxCssLoad && Yii :: app ( ) -> request -> isAjaxRequest ) return ; if ( $ this -> bootstrapCss ) $ this -> registerBootstrapCss ( ) ; if ( $ this -> fontAwesomeCss ) $ this -> registerFontAwesomeCss ( ) ; if ( $... | If we did not disabled registering CSS packages register them . |
53,163 | protected function registerJsPackagesIfEnabled ( ) { if ( ! $ this -> enableJS ) return ; if ( ! $ this -> ajaxJsLoad && Yii :: app ( ) -> request -> isAjaxRequest ) return ; $ this -> registerPackage ( 'bootstrap.js' ) ; $ this -> registerPackage ( 'bootstrap-noconflict' ) ; if ( $ this -> enableBootboxJS ) $ this -> ... | If enableJS is not false register our Javascript packages |
53,164 | public function registerAssetJs ( $ name , $ position = CClientScript :: POS_END ) { $ this -> cs -> registerScriptFile ( $ this -> getAssetsUrl ( ) . "/js/{$name}" , $ position ) ; } | Register a javascript file in the asset s js folder |
53,165 | protected function createSelect2Package ( ) { $ jsFiles = array ( $ this -> minify ? 'select2.min.js' : 'select2.js' ) ; if ( strpos ( Yii :: app ( ) -> language , 'en' ) !== 0 ) { $ locale = 'select2_locale_' . substr ( Yii :: app ( ) -> language , 0 , 2 ) . '.js' ; if ( @ file_exists ( Yii :: getPathOfAlias ( 'booste... | Make select2 package definition |
53,166 | public static function attachAjaxUpdateEvent ( $ widget ) { $ trigger = '$("#' . $ widget -> id . '").trigger("ajaxUpdate.editable");' ; if ( strpos ( $ widget -> afterAjaxUpdate , $ trigger ) !== false ) return ; if ( strlen ( $ widget -> afterAjaxUpdate ) ) { $ orig = $ widget -> afterAjaxUpdate ; if ( strpos ( $ ori... | injects ajaxUpdate event into widget |
53,167 | protected function registerJQueryUI ( ) { $ cs = Yii :: app ( ) -> getClientScript ( ) ; if ( $ this -> themeUrl === null ) { $ this -> themeUrl = $ cs -> getCoreScriptUrl ( ) . '/jui/css' ; } $ cs -> registerCssFile ( $ this -> themeUrl . '/' . $ this -> theme . '/' . $ this -> cssFile ) ; $ cs -> registerPackage ( 'j... | method to register jQuery UI with build - in or custom theme |
53,168 | public function registerClientScript ( $ id ) { Booster :: getBooster ( ) -> cs -> registerPackage ( 'timepicker' ) ; $ options = ! empty ( $ this -> options ) ? CJavaScript :: encode ( $ this -> options ) : '' ; ob_start ( ) ; echo "jQuery('#{$id}').timepicker({$options})" ; foreach ( $ this -> events as $ event => $ ... | Registers required javascript files |
53,169 | protected function getSeparatedSelectableInput ( ) { switch ( $ this -> type ) { case self :: TYPE_CHECKBOX : $ method = 'checkBox' ; break ; case self :: TYPE_RADIO : $ method = 'radioButton' ; break ; default : throw new CException ( 'This method can be used with only selectable control' , E_USER_ERROR ) ; } $ contro... | Obtain separately hidden and visible field |
53,170 | public function processValue ( $ value ) { $ clean = strip_tags ( $ value ) ; $ this -> total += ( ( float ) $ this -> extractNumber ( $ clean ) ) ; } | Process the value to calculate |
53,171 | public function displaySummary ( ) { echo strtr ( $ this -> template , array ( '{label}' => $ this -> label , '{value}' => $ this -> total === null ? '' : Yii :: app ( ) -> format -> format ( $ this -> total , $ this -> column -> type ) ) ) ; } | Displays the summary |
53,172 | protected function getTotal ( ) { if ( null == $ this -> _total ) { $ this -> _total = 0 ; foreach ( $ this -> types as $ type ) { if ( isset ( $ type [ 'value' ] ) ) { $ this -> _total += $ type [ 'value' ] ; } } } return $ this -> _total ; } | Returns the total of types |
53,173 | private function getFileValidatorProperty ( $ model = null , $ attribute = null , $ property = null ) { if ( ! isset ( $ model , $ attribute , $ property ) ) { return null ; } foreach ( $ model -> getValidators ( $ attribute ) as $ validator ) { if ( $ validator instanceof CFileValidator ) { $ ret = $ validator -> $ pr... | Check for a property of CFileValidator |
53,174 | public function renderItems ( ) { echo CHtml :: openTag ( $ this -> itemsTagName , array ( 'class' => $ this -> itemsCssClass ) ) . "\n" ; $ data = $ this -> dataProvider -> getData ( ) ; if ( ! empty ( $ data ) ) { echo CHtml :: openTag ( 'div' , array ( 'class' => 'row' ) ) ; $ owner = $ this -> getOwner ( ) ; $ rend... | Renders the data items for the view . Each item is corresponding to a single data model instance . Child classes should override this method to provide the actual item rendering logic . |
53,175 | protected function radioButtonGroupsList ( ) { if ( isset ( $ this -> htmlOptions [ 'for' ] ) && ! empty ( $ this -> htmlOptions [ 'for' ] ) ) { $ label_for = $ this -> htmlOptions [ 'for' ] ; unset ( $ this -> htmlOptions [ 'for' ] ) ; } else if ( isset ( $ this -> data ) && ! empty ( $ this -> data ) ) { $ label_for ... | Renders a list of radio buttons using Button Groups . |
53,176 | protected function colorpickerField ( ) { $ format = 'hex' ; if ( isset ( $ this -> htmlOptions [ 'format' ] ) ) { $ format = $ this -> htmlOptions [ 'format' ] ; unset ( $ this -> htmlOptions [ 'format' ] ) ; } if ( isset ( $ this -> htmlOptions [ 'events' ] ) ) { $ events = $ this -> htmlOptions [ 'events' ] ; unset ... | Renders a colorpicker field . |
53,177 | protected function select2Field ( ) { if ( isset ( $ this -> htmlOptions [ 'options' ] ) ) { $ options = $ this -> htmlOptions [ 'options' ] ; unset ( $ this -> htmlOptions [ 'options' ] ) ; } if ( isset ( $ this -> htmlOptions [ 'events' ] ) ) { $ events = $ this -> htmlOptions [ 'events' ] ; unset ( $ this -> htmlOpt... | Renders a select2Field |
53,178 | protected function typeAheadField ( ) { echo $ this -> getLabel ( ) ; echo $ this -> getPrepend ( ) ; echo $ this -> form -> typeAheadField ( $ this -> model , $ this -> attribute , $ this -> data , $ this -> htmlOptions ) ; echo $ this -> getAppend ( ) ; echo $ this -> getError ( ) . $ this -> getHint ( ) ; } | Renders a typeahead field |
53,179 | protected function numberField ( ) { echo $ this -> getLabel ( ) ; echo $ this -> getPrepend ( ) ; echo $ this -> form -> numberField ( $ this -> model , $ this -> attribute , $ this -> htmlOptions ) ; echo $ this -> getAppend ( ) ; echo $ this -> getError ( ) . $ this -> getHint ( ) ; } | Renders a number field . |
53,180 | protected function customField ( ) { echo $ this -> getLabel ( ) ; echo $ this -> getPrepend ( ) ; echo $ this -> htmlOptions [ 'input' ] ; echo $ this -> getAppend ( ) ; echo $ this -> getError ( ) . $ this -> getHint ( ) ; } | Renders a pre - rendered custom field |
53,181 | protected function radioButton ( ) { $ attribute = $ this -> attribute ; list ( $ hidden , $ radioButton ) = $ this -> getSeparatedSelectableInput ( ) ; echo '<div class="controls">' ; echo ( $ hidden ) ? $ hidden . PHP_EOL : '' ; echo '<label class="radio" for="' . $ this -> getAttributeId ( $ attribute ) . '">' ; ech... | Renders a radio button . |
53,182 | protected function captcha ( ) { echo $ this -> getLabel ( ) ; echo '<div class="controls"><div class="captcha">' ; echo '<div class="widget">' . $ this -> widget ( 'CCaptcha' , $ this -> captchaOptions , true ) . '</div>' ; echo $ this -> form -> textField ( $ this -> model , $ this -> attribute , $ this -> htmlOption... | Renders a CAPTCHA . |
53,183 | protected function uneditableField ( ) { echo $ this -> getLabel ( ) ; echo '<div class="controls">' ; echo CHtml :: tag ( 'span' , $ this -> htmlOptions , $ this -> model -> { $ this -> attribute } ) ; echo $ this -> getError ( ) . $ this -> getHint ( ) ; echo '</div>' ; } | Renders an uneditable field . |
53,184 | protected function ckEditor ( ) { if ( isset ( $ this -> htmlOptions [ 'options' ] ) ) { $ options = $ this -> htmlOptions [ 'options' ] ; unset ( $ this -> htmlOptions [ 'options' ] ) ; } echo $ this -> getLabel ( ) ; echo '<div class="controls">' ; $ this -> widget ( 'booster.widgets.TbCKEditor' , array ( 'model' => ... | Renders a ckEditor . |
53,185 | protected function dateRangeField ( ) { if ( isset ( $ this -> htmlOptions [ 'options' ] ) ) { $ options = $ this -> htmlOptions [ 'options' ] ; unset ( $ this -> htmlOptions [ 'options' ] ) ; } if ( isset ( $ options [ 'callback' ] ) ) { $ callback = $ options [ 'callback' ] ; unset ( $ options [ 'callback' ] ) ; } ec... | Renders a daterange field . |
53,186 | private function renderExtraRow ( $ beforeRow , $ change , $ columnsInExtra ) { $ data = $ this -> dataProvider -> data [ $ beforeRow ] ; if ( $ this -> extraRowExpression ) { $ content = $ this -> evaluateExpression ( $ this -> extraRowExpression , array ( 'data' => $ data , 'row' => $ beforeRow , 'values' => $ change... | renders extra row |
53,187 | protected function response ( $ data , $ statusCode = 200 , array $ headers = [ ] ) { if ( $ data instanceof Arrayable && ! $ data instanceof JsonSerializable ) { $ data = $ data -> toArray ( ) ; } return new JsonResponse ( $ data , $ statusCode , $ headers ) ; } | Create a json response |
53,188 | protected function parseData ( $ data , array $ options , $ key = null ) { $ architect = new Architect ( ) ; return $ architect -> parseData ( $ data , $ options [ 'modes' ] , $ key ) ; } | Parse data using architect |
53,189 | protected function parseIncludes ( array $ includes ) { $ return = [ 'includes' => [ ] , 'modes' => [ ] ] ; foreach ( $ includes as $ include ) { $ explode = explode ( ':' , $ include ) ; if ( ! isset ( $ explode [ 1 ] ) ) { $ explode [ 1 ] = $ this -> defaults [ 'mode' ] ; } $ return [ 'includes' ] [ ] = $ explode [ 0... | Parse include strings into resource and modes |
53,190 | protected function parseResourceOptions ( $ request = null ) { if ( $ request === null ) { $ request = request ( ) ; } $ this -> defaults = array_merge ( [ 'includes' => [ ] , 'sort' => [ ] , 'limit' => null , 'page' => null , 'mode' => 'embed' , 'filter_groups' => [ ] ] , $ this -> defaults ) ; $ includes = $ this -> ... | Parse GET parameters into resource options |
53,191 | protected function applyResourceOptions ( Builder $ queryBuilder , array $ options = [ ] ) { if ( empty ( $ options ) ) { return $ queryBuilder ; } extract ( $ options ) ; if ( isset ( $ includes ) ) { if ( ! is_array ( $ includes ) ) { throw new InvalidArgumentException ( 'Includes should be an array.' ) ; } $ queryBu... | Apply resource options to a query builder |
53,192 | public function serialize ( OpenQuestion $ wordsQuestion , array $ options = [ ] ) { $ serialized = [ ] ; if ( in_array ( Transfer :: INCLUDE_SOLUTIONS , $ options ) ) { $ serialized [ 'solutions' ] = $ this -> serializeSolutions ( $ wordsQuestion , $ options ) ; } return $ serialized ; } | Converts a Words question into a JSON - encodable structure . |
53,193 | public function deserialize ( $ data , OpenQuestion $ wordsQuestion = null , array $ options = [ ] ) { if ( empty ( $ wordsQuestion ) ) { $ wordsQuestion = new OpenQuestion ( ) ; } $ this -> deserializeSolutions ( $ wordsQuestion , $ data [ 'solutions' ] , $ options ) ; return $ wordsQuestion ; } | Converts raw data into an Words question entity . |
53,194 | public function parse ( $ text , $ replaceLinks = true ) { $ resources = [ ] ; $ regex = '#[src|href]+="([^"]*file/resource/media/([^\'"]+))"#' ; preg_match_all ( $ regex , $ text , $ matches , PREG_SET_ORDER ) ; if ( count ( $ matches ) > 0 ) { foreach ( $ matches as $ match ) { $ node = $ this -> resourceManager -> g... | Parses a rich text to extract the resource list . |
53,195 | public function getNotificationsReadAction ( User $ user ) { $ this -> notificationManager -> markAllNotificationsAsViewed ( $ user -> getId ( ) ) ; return $ this -> notificationManager -> getUserNotifications ( $ user ) ; } | Mark all notifications as read . |
53,196 | public function load ( $ pluginFqcn , $ pluginPath = null ) { if ( ! $ pluginPath ) { $ rPlugin = new \ ReflectionClass ( $ pluginFqcn ) ; $ pluginPath = $ rPlugin -> getFileName ( ) ; } if ( ! file_exists ( $ pluginPath ) ) { throw new RuntimeException ( "No bundle class file matches the FQCN '{$pluginFqcn}' " . '(exp... | Searches a plugin bundle by its FQCN and returns an instance of it . |
53,197 | public function findWithStatus ( ) { $ scales = $ this -> createQueryBuilder ( 's' ) -> select ( 's.id' , 's.name' , 'COUNT(c) AS competencies' ) -> leftJoin ( 's.competencies' , 'c' ) -> groupBy ( 's' ) -> getQuery ( ) -> getArrayResult ( ) ; $ abilityCounts = $ this -> createQueryBuilder ( 's' ) -> select ( 's.id' , ... | Returns an array representation of registered scales including information about linked frameworks and abilities . |
53,198 | public function findCompetencyCount ( Scale $ scale ) { return $ this -> createQueryBuilder ( 's' ) -> select ( 'COUNT(c) AS competencies' ) -> leftJoin ( 's.competencies' , 'c' ) -> where ( 's = :scale' ) -> groupBy ( 's' ) -> getQuery ( ) -> setParameter ( ':scale' , $ scale ) -> getSingleScalarResult ( ) ; } | Returns the number of competency frameworks linked to a scale . |
53,199 | public function indexAction ( $ publicUrl ) { $ this -> checkAccess ( ) ; try { $ user = $ this -> userRepo -> findOneByIdOrPublicUrl ( $ publicUrl ) ; $ evaluations = $ this -> resourceUserEvaluationRepo -> findBy ( [ 'user' => $ user ] , [ 'date' => 'desc' ] ) ; return [ 'user' => $ this -> serializer -> serialize ( ... | Displays a user tracking . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.