idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
53,000 | public function store ( array $ data ) { $ exception = new ExceptionModel ( ) ; $ exception -> type = $ data [ 'exception' ] ; $ exception -> code = $ data [ 'code' ] ; $ exception -> message = $ data [ 'message' ] ; $ exception -> file = $ data [ 'file' ] ; $ exception -> line = $ data [ 'line' ] ; $ exception -> trac... | Store exception info to db . |
53,001 | public function getAccessToken ( $ token , $ verifier , TemporaryCredentials $ temporaryCredentials = null ) { return $ this -> getAuthorization ( ) -> getToken ( $ token , $ verifier , $ temporaryCredentials ) ; } | Retrives access token credentials with token and verifier . |
53,002 | public function getBatch ( $ attributes = [ ] ) { $ this -> parseBatchAttributes ( $ attributes ) ; try { $ result = $ this -> getHttp ( ) -> get ( 'batch' , [ 'urls' => $ this -> batchUrls ] ) ; $ this -> batchUrls = [ ] ; return $ result ; } catch ( Exception $ e ) { throw $ e ; } } | Retrieves http response from Trello api for batch collection . |
53,003 | protected function parseBatchAttributes ( $ attributes = [ ] ) { if ( isset ( $ attributes [ 'urls' ] ) ) { if ( is_array ( $ attributes [ 'urls' ] ) ) { $ this -> addBatchUrls ( $ attributes [ 'urls' ] ) ; } elseif ( is_string ( $ attributes [ 'urls' ] ) ) { $ this -> addBatchUrl ( $ attributes [ 'urls' ] ) ; } } } | Attempts to parse attributes to pull valid urls . |
53,004 | private function getMethodSignature ( $ method ) { $ validMethod = isset ( $ this -> methods [ $ method ] ) && is_array ( $ this -> methods [ $ method ] ) && count ( $ this -> methods [ $ method ] ) >= 2 ; if ( $ validMethod ) { return $ this -> methods [ $ method ] ; } return null ; } | Attempts to retrieve method signature from method definition . |
53,005 | protected function authenticateRequest ( RequestInterface $ request ) { $ uri = $ request -> getUri ( ) ; parse_str ( $ uri -> getQuery ( ) , $ query ) ; $ query [ 'key' ] = Configuration :: get ( 'key' ) ; $ query [ 'token' ] = Configuration :: get ( 'token' ) ; $ uri = $ uri -> withQuery ( http_build_query ( $ query ... | Adds authentication credentials to given request . |
53,006 | protected function createRequest ( $ verb , $ path , $ parameters = [ ] ) { if ( isset ( $ parameters [ 'file' ] ) ) { $ this -> queueResourceAs ( 'file' , Psr7 \ stream_for ( $ parameters [ 'file' ] ) ) ; unset ( $ parameters [ 'file' ] ) ; } $ request = new Request ( $ verb , $ this -> getUrlFromPath ( $ path ) , $ t... | Creates a request . |
53,007 | public function delete ( $ path , $ parameters = [ ] ) { $ request = $ this -> getRequest ( static :: HTTP_DELETE , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; } | Retrieves http response for a request with the delete method . |
53,008 | public function get ( $ path , $ parameters = [ ] ) { $ request = $ this -> getRequest ( static :: HTTP_GET , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; } | Retrieves http response for a request with the get method . |
53,009 | public function getRequest ( $ method , $ path , $ parameters = [ ] , $ authenticated = true ) { $ request = $ this -> createRequest ( $ method , $ path , $ parameters ) ; if ( $ authenticated ) { $ request = $ this -> authenticateRequest ( $ request ) ; } return $ request ; } | Creates and returns a request . |
53,010 | private function getRequestExceptionParts ( RequestException $ requestException ) { $ response = $ requestException -> getResponse ( ) ; $ parts = [ ] ; $ parts [ 'reason' ] = $ response ? $ response -> getReasonPhrase ( ) : $ requestException -> getMessage ( ) ; $ parts [ 'code' ] = $ response ? $ response -> getStatu... | Prepares an array of important exception parts based on composition of a given exception . |
53,011 | protected function getRequestOptions ( ) { $ options = [ 'proxy' => Configuration :: get ( 'proxy' ) ] ; if ( ! empty ( array_filter ( $ this -> multipartResources ) ) ) { $ options [ 'multipart' ] = $ this -> multipartResources ; } return $ options ; } | Creates an array of request options based on the current status of the http client . |
53,012 | public function post ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_POST , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; } | Retrieves http response for a request with the post method . |
53,013 | public function put ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_PUT , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; } | Retrieves http response for a request with the put method . |
53,014 | public function putAsBody ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_PUT , $ path ) -> withBody ( Psr7 \ stream_for ( json_encode ( $ parameters ) ) ) -> withHeader ( 'content-type' , 'application/json' ) ; return $ this -> sendRequest ( $ request ) ; } | Retrieves http response for a request with the put method ensuring parameters are passed as body . |
53,015 | protected function sendRequest ( RequestInterface $ request ) { try { $ response = $ this -> httpClient -> send ( $ request , $ this -> getRequestOptions ( ) ) ; $ this -> multipartResources = [ ] ; return json_decode ( $ response -> getBody ( ) ) ; } catch ( RequestException $ e ) { $ this -> throwRequestException ( $... | Retrieves http response for a given request . |
53,016 | protected function throwRequestException ( RequestException $ requestException ) { $ exceptionParts = $ this -> getRequestExceptionParts ( $ requestException ) ; $ exception = new Exceptions \ Exception ( $ exceptionParts [ 'reason' ] , $ exceptionParts [ 'code' ] , $ requestException ) ; $ body = $ exceptionParts [ 'b... | Creates local exception from guzzle request exception which includes response body . |
53,017 | public static function get ( $ key = null , $ default = null ) { if ( ! empty ( $ key ) ) { return isset ( static :: $ settings [ $ key ] ) ? static :: $ settings [ $ key ] : $ default ; } return static :: $ settings ; } | Attempts to retrieve a given key from configuration settings . Returns default if not set . |
53,018 | public static function parseDefaultOptions ( $ options = [ ] , $ defaults = [ ] ) { array_walk ( $ defaults , function ( $ value , $ key ) use ( & $ options ) { if ( ! isset ( $ options [ $ key ] ) ) { $ options [ $ key ] = $ value ; } } ) ; return $ options ; } | Parses give options against default options . |
53,019 | public static function setMany ( $ settings = [ ] , $ defaultSettings = [ ] ) { $ settings = static :: parseDefaultOptions ( $ settings , $ defaultSettings ) ; array_walk ( $ settings , function ( $ value , $ key ) { static :: set ( $ key , $ value ) ; } ) ; } | Updates configuration settings with collection of key value pairs . |
53,020 | public function addConfig ( ) { $ params = func_get_args ( ) ; if ( ! empty ( $ params ) ) { if ( is_array ( $ params [ 0 ] ) ) { forward_static_call_array ( [ Configuration :: class , 'setMany' ] , $ params ) ; } else { forward_static_call_array ( [ Configuration :: class , 'set' ] , $ params ) ; } } return $ this ; } | Updates configuration settings with key value pairs . |
53,021 | protected function createClient ( ) { $ this -> client = new OAuthServer ( [ 'identifier' => Configuration :: get ( 'key' ) , 'secret' => Configuration :: get ( 'secret' ) , 'callback_uri' => Configuration :: get ( 'callbackUrl' ) , 'name' => Configuration :: get ( 'name' ) , 'expiration' => Configuration :: get ( 'exp... | Creates a new OAuth server client and attaches to authorization broker . |
53,022 | public function getToken ( $ oauthToken , $ oauthVerifier , TemporaryCredentials $ temporaryCredentials = null ) { if ( is_null ( $ temporaryCredentials ) ) { $ sessionKey = self :: getCredentialSessionKey ( ) ; $ temporaryCredentials = unserialize ( $ _SESSION [ $ sessionKey ] ) ; unset ( $ _SESSION [ $ sessionKey ] )... | Verify and fetch token |
53,023 | public function buildUrl ( $ method = '' , $ params = '' , $ append = true ) { return $ this -> bbbServerBaseUrl . 'api/' . $ method . ( $ append ? '?' . $ this -> buildQs ( $ method , $ params ) : '' ) ; } | Builds an API method URL that includes the url + params + its generated checksum . |
53,024 | private function processXmlResponse ( $ url , $ payload = '' , $ contentType = 'application/xml' ) { if ( extension_loaded ( 'curl' ) ) { $ ch = curl_init ( ) ; if ( ! $ ch ) { throw new \ RuntimeException ( 'Unhandled curl error: ' . curl_error ( $ ch ) ) ; } $ timeout = 10 ; $ cookiefile = tmpfile ( ) ; $ cookiefilep... | A private utility method used by other public methods to process XML responses . |
53,025 | private function CreateSignedAwsRequest ( $ request , $ version = '2011-08-01' ) { $ uri_elements = parse_url ( $ request ) ; $ request = $ uri_elements [ 'query' ] ; parse_str ( $ request , $ parameters ) ; $ parameters [ 'Timestamp' ] = gmdate ( "Y-m-d\TH:i:s\Z" ) ; $ parameters [ 'Version' ] = $ version ; ksort ( $ ... | This function will take an existing Amazon request and change it so that it will be usable with the new authentication . |
53,026 | public function ItemSearch ( $ keywords , $ searchIndex = NULL , $ sortBy = NULL , $ condition = 'New' ) { $ params = array ( 'Operation' => 'ItemSearch' , 'ResponseGroup' => 'ItemAttributes,Offers,Images' , 'Keywords' => $ keywords , 'Condition' => $ condition , 'SearchIndex' => empty ( $ searchIndex ) ? 'All' : $ sea... | Search for items |
53,027 | public function ItemLookup ( $ asinList , $ onlyFromAmazon = false ) { if ( is_array ( $ asinList ) ) { $ asinList = implode ( ',' , $ asinList ) ; } $ params = array ( 'Operation' => 'ItemLookup' , 'ResponseGroup' => 'ItemAttributes,Offers,Reviews,Images,EditorialReview' , 'ReviewSort' => '-OverallRating' , 'ItemId' =... | Lookup items from ASINs |
53,028 | public function registerClientScript ( ) { $ cs = Yii :: app ( ) -> getClientScript ( ) ; $ cs -> registerPackage ( 'picker' ) ; $ pickerOptions = CJavaScript :: encode ( $ this -> pickerOptions ) ; $ gridId = $ this -> grid -> id ; $ class = preg_replace ( '/\s+/' , '.' , $ this -> class ) ; $ cs -> registerScript ( _... | Registers client script data |
53,029 | public function run ( ) { $ key = yii :: app ( ) -> request -> getParam ( 'name' ) ; $ tooltip = Yii :: app ( ) -> request -> getParam ( 'value' ) ; if ( ! $ key || ! $ tooltip ) { throw new CHttpException ( 404 , Yii :: t ( 'zii' , 'Unauthorized request' ) ) ; } if ( ! $ this -> getDbConnection ( ) -> createCommand ( ... | CAction run s method |
53,030 | protected function renderTableBodyJSON ( $ rows ) { $ tbody = array ( 'headers' => array ( ) , 'rows' => array ( ) , 'keys' => array ( ) , 'summary' => array ( ) ) ; foreach ( $ this -> columns as $ column ) { $ tbody [ 'headers' ] [ ] = $ column -> renderHeaderCell ( ) ; } if ( $ rows > 0 ) { for ( $ row = 0 ; $ row <... | Renders the body table for JSON requests - assumed ajax is for JSON |
53,031 | public static function defaultValues ( array $ values , array & $ array ) { foreach ( $ values as $ name => $ value ) { self :: defaultValue ( $ name , $ value , $ array ) ; } } | Sets a set of default values for the given array . |
53,032 | public static function copyValues ( array $ keys , array $ from , array $ to , $ force = false ) { foreach ( $ keys as $ key ) { if ( isset ( $ from [ $ key ] ) ) { if ( $ force || ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = self :: getValue ( $ key , $ from ) ; } } } return $ to ; } | Copies the given values from one array to another . |
53,033 | public static function moveValues ( array $ keys , array & $ from , array $ to , $ force = false ) { foreach ( $ keys as $ key ) { if ( isset ( $ from [ $ key ] ) ) { $ value = self :: popValue ( $ key , $ from ) ; if ( $ force || ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = $ value ; unset ( $ from [ $ key ] ) ; } ... | Moves the given values from one array to another . |
53,034 | public static function merge ( array $ to , array $ from ) { $ args = func_get_args ( ) ; $ res = array_shift ( $ args ) ; while ( ! empty ( $ args ) ) { $ next = array_shift ( $ args ) ; foreach ( $ next as $ k => $ v ) { if ( is_integer ( $ k ) ) { isset ( $ res [ $ k ] ) ? $ res [ ] = $ v : $ res [ $ k ] = $ v ; } e... | Merges two arrays . |
53,035 | public function urlFieldGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'urlField' ) , array ( $ model ,... | Generates a url field group for a model attribute . |
53,036 | public function passwordFieldGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ this -> addCssClass ( $ options [ 'widgetOptions' ] [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'passwordField' ) , array ( $ model , $ attribute , $ options [... | Generates a password field group for a model attribute . |
53,037 | public function radioButtonGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] [ 'htmlOptions' ] ; self :: addCssClass ( $ options [ 'labelOptions' ] , 'radio' ) ; if ( $ this -> type == self :: TYPE_INLINE || ( isset ( $ option... | Generates a radio button group for a model attribute . |
53,038 | public function listBoxGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options , true ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'listBox' ) , array ( $ mo... | Generates a list box group for a model attribute . |
53,039 | public function checkboxListGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options , true ) ; $ widgetOptions = $ options [ 'widgetOptions' ] [ 'htmlOptions' ] ; if ( ! isset ( $ widgetOptions [ 'labelOptions' ] [ 'class' ] ) ) $ widgetOptions [ 'labelOptions' ] [ 'class' ] = 'check... | Generates a checkbox list group for a model attribute . |
53,040 | public function captchaGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = $ this -> textField ( $ model , $ attribute , $ widgetOpti... | Generates a color picker field group for a model attribute . |
53,041 | public function widgetGroup ( $ className , $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = isset ( $ options [ 'widgetOptions' ] ) ? $ options [ 'widgetOptions' ] : null ; $ fieldData = array ( array ( $ this -> owner , 'widget' ) , array ( $ className , $ widg... | Generates a widget group for a model attribute . |
53,042 | protected function widgetGroupInternal ( $ className , & $ model , & $ attribute , & $ options ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ widgetOptions [ 'model' ] = $ model ; $ widgetOptions [ 'attribute' ] = $ attribute ; $ this -> addCssClass ( $ widgetOptions [ 'ht... | This is a intermediate method for widget - based group methods . |
53,043 | protected function customFieldGroupInternal ( & $ fieldData , & $ model , & $ attribute , & $ options ) { $ this -> setDefaultPlaceholder ( $ fieldData ) ; ob_start ( ) ; switch ( $ this -> type ) { case self :: TYPE_HORIZONTAL : $ this -> horizontalGroup ( $ fieldData , $ model , $ attribute , $ options ) ; break ; ca... | Generates a custom field group for a model attribute . |
53,044 | protected function setDefaultPlaceholder ( & $ fieldData ) { if ( ! is_array ( $ fieldData ) || empty ( $ fieldData [ 0 ] [ 1 ] ) || ! is_array ( $ fieldData [ 1 ] ) ) return ; $ model = $ fieldData [ 1 ] [ 0 ] ; if ( ! $ model instanceof CModel ) return ; $ attribute = $ fieldData [ 1 ] [ 1 ] ; if ( ! empty ( $ fieldD... | Sets default placeholder value in case of CModel attribute depending on attribute label |
53,045 | protected function inlineGroup ( & $ fieldData , & $ model , & $ attribute , & $ options ) { $ groupOptions = isset ( $ options [ 'groupOptions' ] ) ? $ options [ 'groupOptions' ] : array ( ) ; self :: addCssClass ( $ groupOptions , 'form-group' ) ; echo CHtml :: openTag ( 'div' , $ groupOptions ) ; if ( isset ( $ opti... | Renders a inline custom field group for a model attribute . |
53,046 | protected function renderAddOnBegin ( $ prependText , $ appendText , $ prependOptions ) { $ wrapperCssClass = array ( ) ; if ( ! empty ( $ prependText ) ) $ wrapperCssClass [ ] = $ this -> prependCssClass ; if ( ! empty ( $ appendText ) ) $ wrapperCssClass [ ] = $ this -> appendCssClass ; echo CHtml :: tag ( $ this -> ... | Renders add - on begin . |
53,047 | protected function renderAddOnEnd ( $ appendText , $ appendOptions ) { if ( ! empty ( $ appendText ) ) { if ( isset ( $ appendOptions [ 'isRaw' ] ) && $ appendOptions [ 'isRaw' ] ) { echo $ appendText ; } else { self :: addCssClass ( $ appendOptions , $ this -> addOnCssClass ) ; echo CHtml :: tag ( $ this -> addOnTag ,... | Renders add - on end . |
53,048 | protected function maskedTextField ( ) { $ this -> setPlaceholder ( ) ; echo $ this -> getPrepend ( ) ; echo $ this -> form -> maskedTextField ( $ this -> model , $ this -> attribute , $ this -> data , $ this -> htmlOptions ) ; echo $ this -> getAppend ( ) ; } | Renders a masked text field . |
53,049 | public function run ( ) { list ( $ name , $ id ) = $ this -> resolveNameID ( ) ; if ( $ this -> hasModel ( ) ) { if ( $ this -> form ) { echo $ this -> form -> checkBox ( $ this -> model , $ this -> attribute , $ this -> htmlOptions ) ; } else { echo CHtml :: activeCheckBox ( $ this -> model , $ this -> attribute , $ t... | Widget s run function |
53,050 | protected function registerClientScript ( $ id ) { $ booster = Booster :: getBooster ( ) ; $ booster -> registerPackage ( 'switch' ) ; $ config = CJavaScript :: encode ( $ this -> options ) ; ob_start ( ) ; echo "$('input#$id').bootstrapSwitch({$config})" ; foreach ( $ this -> events as $ event => $ handler ) { $ event... | Registers required css and js files |
53,051 | protected function renderDataCellContent ( $ row , $ data ) { $ content = $ this -> emptyText ; if ( $ this -> imagePathExpression && $ imagePath = $ this -> evaluateExpression ( $ this -> imagePathExpression , array ( 'row' => $ row , 'data' => $ data ) ) ) { $ this -> imageOptions [ 'src' ] = $ imagePath ; $ content ... | Renders the data cell content |
53,052 | public function renderHeaderCell ( ) { if ( $ this -> grid -> json ) { ob_start ( ) ; $ this -> renderHeaderCellContent ( ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; return array ( 'id' => $ this -> id , 'content' => $ content ) ; } parent :: renderHeaderCell ( ) ; return array ( ) ; } | Renders|returns the header cell . |
53,053 | public function renderDataCell ( $ row ) { if ( $ this -> grid -> json ) { $ data = $ this -> grid -> dataProvider -> data [ $ row ] ; $ options = $ this -> htmlOptions ; if ( $ this -> cssClassExpression !== null ) { $ class = $ this -> evaluateExpression ( $ this -> cssClassExpression , array ( 'row' => $ row , 'data... | Renders|returns the data cell |
53,054 | public function setPath ( $ path ) { if ( is_dir ( $ path ) && is_writable ( $ path ) ) { $ this -> path = substr ( $ path , - 1 ) == DIRECTORY_SEPARATOR ? $ path : $ path . DIRECTORY_SEPARATOR ; return true ; } throw new Exception ( '"Path" must be a writable directory.' ) ; } | Property set path |
53,055 | public function verify ( ) { $ registry = function_exists ( 'json_encode' ) ? json_encode ( $ this -> data [ self :: REGISTRY ] ) : CJSON :: encode ( $ this -> data [ self :: REGISTRY ] ) ; return $ this -> data [ self :: META ] [ "hash" ] == md5 ( $ registry ) ; } | Verifies data integrity |
53,056 | public function load ( ) { $ filename = $ this -> getFile ( ) ; if ( ! file_exists ( $ filename ) ) return ; $ json = file_get_contents ( $ filename ) ; if ( strlen ( $ json ) == 0 ) return ; $ data = $ this -> decode ( $ json ) ; if ( $ data === null ) throw new Exception ( 'Error while trying to decode ' . $ filename... | Loads registry data into memory |
53,057 | public function save ( ) { if ( $ this -> hasEventHandler ( 'onBeforeSave' ) ) { $ this -> onBeforeSave ( new CEvent ( $ this ) ) ; } $ this -> flush ( ) ; if ( $ this -> hasEventHandler ( 'onAfterSave' ) ) { $ this -> onAfterSave ( new CEvent ( $ this ) ) ; } } | Saves registry data to the file |
53,058 | public function setData ( $ key , $ data , $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ key . $ registry ) && $ this -> registryExists ( $ registry ) ) { $ this -> data [ self :: REGISTRY ] [ $ registry ] [ $ key ] = $ data ; $ this -> dirty = true ; return tru... | Saves data to the registry |
53,059 | public function getData ( $ key , $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ key . $ registry ) && $ this -> registryExists ( $ registry ) ) { if ( array_key_exists ( $ key , $ this -> data [ self :: REGISTRY ] [ $ registry ] ) ) { return $ this -> data [ sel... | Retrieves a data value from the registry |
53,060 | public function getLength ( $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ registry ) && $ this -> registryExists ( $ registry ) ) { return count ( $ this -> data [ self :: REGISTRY ] [ $ registry ] ) ; } return 0 ; } | Retrieves the number of keys in registry |
53,061 | public function getRegistry ( $ registry ) { return $ this -> registryExists ( $ registry ) ? $ this -> data [ self :: REGISTRY ] [ $ registry ] : null ; } | Retrieves a registry collection based on its name |
53,062 | public function addRegistry ( $ registry ) { if ( $ this -> registryExists ( $ registry ) ) { return false ; } $ this -> data [ self :: REGISTRY ] [ $ registry ] = array ( ) ; $ this -> dirty = true ; return true ; } | Add new collection name |
53,063 | private function flush ( ) { if ( $ this -> dirty == false ) return true ; $ data = $ this -> data ; $ registry = $ this -> encode ( $ this -> data [ self :: REGISTRY ] ) ; $ data [ self :: META ] [ "updated" ] = date ( "c" ) ; $ data [ self :: META ] [ "hash" ] = md5 ( $ registry ) ; $ written = file_put_contents ( $ ... | Saves the global registry to the file |
53,064 | private function decode ( $ data ) { return function_exists ( 'json_decode' ) ? json_decode ( $ data , true ) : CJSON :: decode ( $ data , true ) ; } | JSON decodes the data |
53,065 | protected function generateGroupOptions ( ) { $ options = array ( ) ; $ fields = array ( 'widgetOptions, label' , 'labelOptions' , 'errorOptions' , 'hint' , 'hintOptions' , 'prepend' , 'prependOptions' , 'append' , 'appendOptions' , 'enableAjaxValidation' , 'enableClientValidation' ) ; foreach ( $ fields as $ prop ) { ... | Generates row options array from this class properties . |
53,066 | public function render ( ) { $ model = $ this -> getParent ( ) -> getModel ( ) ; $ attribute = $ this -> name ; $ options = $ this -> generateGroupOptions ( ) ; if ( isset ( self :: $ inputTypes [ $ this -> type ] ) ) { $ method = self :: $ inputTypes [ $ this -> type ] ; return $ this -> getParent ( ) -> getActiveForm... | Render this element . |
53,067 | public static function lead ( $ text , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'lead' , $ htmlOptions ) ; return self :: tag ( 'p' , $ htmlOptions , $ text ) ; } | Generates a paragraph that stands out . |
53,068 | public static function em ( $ text , $ htmlOptions = array ( ) , $ tag = 'p' ) { $ color = TbArray :: popValue ( 'color' , $ htmlOptions ) ; if ( TbArray :: popValue ( 'muted' , $ htmlOptions , false ) ) { self :: addCssClass ( 'muted' , $ htmlOptions ) ; } else { if ( ! empty ( $ color ) ) { self :: addCssClass ( 'tex... | Generates an emphasized text . |
53,069 | public static function muted ( $ text , $ htmlOptions = array ( ) , $ tag = 'p' ) { $ htmlOptions [ 'muted' ] = true ; return self :: em ( $ text , $ htmlOptions , $ tag ) ; } | Generates a muted text block . |
53,070 | public static function abbr ( $ text , $ word , $ htmlOptions = array ( ) ) { if ( TbArray :: popValue ( 'small' , $ htmlOptions , false ) ) { self :: addCssClass ( 'initialism' , $ htmlOptions ) ; } $ htmlOptions [ 'title' ] = $ word ; return self :: tag ( 'abbr' , $ htmlOptions , $ text ) ; } | Generates an abbreviation with a help text . |
53,071 | public static function smallAbbr ( $ text , $ word , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'small' ] = true ; return self :: abbr ( $ text , $ word , $ htmlOptions ) ; } | Generates a small abbreviation with a help text . |
53,072 | public static function quote ( $ text , $ htmlOptions = array ( ) ) { $ paragraphOptions = TbArray :: popValue ( 'paragraphOptions' , $ htmlOptions , array ( ) ) ; $ source = TbArray :: popValue ( 'source' , $ htmlOptions ) ; $ sourceOptions = TbArray :: popValue ( 'sourceOptions' , $ htmlOptions , array ( ) ) ; $ cite... | Generates a quote . |
53,073 | public static function help ( $ text , $ htmlOptions = array ( ) ) { $ type = TbArray :: popValue ( 'type' , $ htmlOptions , self :: HELP_TYPE_INLINE ) ; self :: addCssClass ( 'help-' . $ type , $ htmlOptions ) ; return self :: tag ( $ type === self :: HELP_TYPE_INLINE ? 'span' : 'p' , $ htmlOptions , $ text ) ; } | Generates a help text . |
53,074 | public static function helpBlock ( $ text , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'type' ] = self :: HELP_TYPE_BLOCK ; return self :: help ( $ text , $ htmlOptions ) ; } | Generates a help block . |
53,075 | public static function formTb ( $ layout = self :: FORM_LAYOUT_VERTICAL , $ action = '' , $ method = 'post' , $ htmlOptions = array ( ) ) { return self :: beginFormTb ( $ layout , $ action , $ method , $ htmlOptions ) ; } | Generates a form tag . |
53,076 | public static function statefulFormTb ( $ layout = self :: FORM_LAYOUT_VERTICAL , $ action = '' , $ method = 'post' , $ htmlOptions = array ( ) ) { return self :: formTb ( $ layout , $ action , $ method , $ htmlOptions ) . self :: tag ( 'div' , array ( 'style' => 'display: none' ) , parent :: pageStateField ( '' ) ) ; ... | Generates a stateful form tag . |
53,077 | public static function checkBox ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { $ label = TbArray :: popValue ( 'label' , $ htmlOptions , false ) ; $ labelOptions = TbArray :: popValue ( 'labelOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'checkbox' , $ labelOptions ) ; $ input = parent ::... | Generates a check box . |
53,078 | public static function listBox ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { if ( isset ( $ htmlOptions [ 'multiple' ] ) ) { if ( substr ( $ name , - 2 ) !== '[]' ) { $ name .= '[]' ; } } TbArray :: defaultValue ( 'displaySize' , 4 , $ htmlOptions ) ; return self :: dropDownList ( $ name , $ select , $ d... | Generates a list box . |
53,079 | public static function radioButtonList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ inline = TbArray :: popValue ( 'inline' , $ htmlOptions , false ) ; $ separator = TbArray :: popValue ( 'separator' , $ htmlOptions , ' ' ) ; $ container = TbArray :: popValue ( 'container' , $ htmlOptions , 'span' ) ;... | Generates a radio button list . |
53,080 | public static function inlineRadioButtonList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: radioButtonList ( $ name , $ select , $ data , $ htmlOptions ) ; } | Generates an inline radio button list . |
53,081 | public static function inlineCheckBoxList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: checkBoxList ( $ name , $ select , $ data , $ htmlOptions ) ; } | Generates an inline check box list . |
53,082 | public static function uneditableField ( $ value , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'uneditable-input' , $ htmlOptions ) ; $ htmlOptions = self :: normalizeInputOptions ( $ htmlOptions ) ; return self :: tag ( 'span' , $ htmlOptions , $ value ) ; } | Generates an uneditable input . |
53,083 | public static function searchQueryField ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'search-query' , $ htmlOptions ) ; return self :: textField ( $ name , $ value , $ htmlOptions ) ; } | Generates a search input . |
53,084 | public static function textFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_TEXT , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a text field . |
53,085 | public static function passwordFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_PASSWORD , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a password field . |
53,086 | public static function urlFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_URL , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with an url field . |
53,087 | public static function emailFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_EMAIL , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with an email field . |
53,088 | public static function numberFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_NUMBER , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a number field . |
53,089 | public static function rangeFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RANGE , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a range field . |
53,090 | public static function textAreaControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_TEXTAREA , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a text area . |
53,091 | public static function radioButtonControlGroup ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RADIOBUTTON , $ name , $ checked , $ htmlOptions ) ; } | Generates a control group with a radio button . |
53,092 | public static function checkBoxControlGroup ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_CHECKBOX , $ name , $ checked , $ htmlOptions ) ; } | Generates a control group with a check box . |
53,093 | public static function dropDownListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_DROPDOWNLIST , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with a drop down list . |
53,094 | public static function listBoxControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_LISTBOX , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with a list box . |
53,095 | public static function radioButtonListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RADIOBUTTONLIST , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with a radio button list . |
53,096 | public static function inlineRadioButtonListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_INLINERADIOBUTTONLIST , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with an inline radio button list . |
53,097 | public static function checkBoxListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_CHECKBOXLIST , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with a check box list . |
53,098 | public static function inlineCheckBoxListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_INLINECHECKBOXLIST , $ name , $ select , $ htmlOptions , $ data ) ; } | Generates a control group with an inline check box list . |
53,099 | public static function searchQueryControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_SEARCH , $ name , $ value , $ htmlOptions ) ; } | Generates a control group with a search field . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.