_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q263200
VerifyDeployRequest.handle
test
public function handle($request, Closure $next) { if ($request->path() === config('auto-deploy.route')) { if (!config('auto-deploy.require-ssl') || $request->secure()) { $origin = $this->determineOrigin(); if (null !== $origin) { if ($origin->i...
php
{ "resource": "" }
q263201
ContainerNamespace.importFromVendor
test
public function importFromVendor(string $vendorDir) { $mappingFile = $vendorDir . '/container_map.php'; if (!(file_exists($mappingFile) && is_readable($mappingFile))) { throw new ContainerNamespaceException("Could not find the the container map file at: " . $mappingFile); ...
php
{ "resource": "" }
q263202
ContainerNamespace.has
test
public function has(string $name) : bool { return isset($this->paths[$name]) && is_string($this->paths[$name]); }
php
{ "resource": "" }
q263203
ContainerNamespace.getCodeFromFile
test
protected function getCodeFromFile(string $containerFilePath) : string { if (!file_exists($containerFilePath) || !is_readable($containerFilePath)) { throw new ContainerNamespaceException("The file '" . $containerFilePath . "' is not readable or does not exist."); } retur...
php
{ "resource": "" }
q263204
ContainerNamespace.getCode
test
public function getCode(string $name) : string { if (!$this->has($name)) { throw new ContainerNamespaceException("There is no path named '" . $name . "' binded to the namespace."); } return $this->getCodeFromFile($this->paths[$name]); }
php
{ "resource": "" }
q263205
ContainerNamespace.parse
test
public function parse(string $containerFilePath) { // create a lexer from the given file $lexer = new ContainerLexer($this->getCodeFromFile($containerFilePath)); // parse the file $parser = new ScopeParser($lexer->tokens()); // interpret the parsed node $interpreter...
php
{ "resource": "" }
q263206
ContainerInterpreter.handleScope
test
public function handleScope(ScopeNode $scope) { foreach($scope->getNodes() as $node) { if ($node instanceof ScopeImportNode) { $this->handleScopeImport($node); } elseif ($node instanceof ParameterDefinitionNode) { $this->handleParameterDefi...
php
{ "resource": "" }
q263207
ContainerInterpreter.handleScopeImport
test
public function handleScopeImport(ScopeImportNode $import) { $path = $import->getPath(); if (is_null($path) || empty($path)) { throw new ContainerInterpreterException("An import statement cannot be empty."); } $code = $this->namespace->getCode($path); /...
php
{ "resource": "" }
q263208
ContainerInterpreter.handleParameterDefinition
test
public function handleParameterDefinition(ParameterDefinitionNode $definition) { if ($this->namespace->hasParameter($definition->getName()) && $definition->isOverride() === false) { throw new ContainerInterpreterException("A parameter named \"{$definition->getName()}\" is already define...
php
{ "resource": "" }
q263209
ContainerInterpreter.createServiceArgumentsFromNode
test
protected function createServiceArgumentsFromNode(ArgumentArrayNode $argumentsNode) : ServiceArguments { $arguments = $argumentsNode ->getArguments(); $definition = new ServiceArguments(); foreach($arguments as $argument) { if ($argument instanceof ServiceR...
php
{ "resource": "" }
q263210
ContainerInterpreter.handleServiceDefinition
test
public function handleServiceDefinition(ServiceDefinitionNode $definition) { if ($this->namespace->hasService($definition->getName()) && $definition->isOverride() === false) { throw new ContainerInterpreterException("A service named \"{$definition->getName()}\" is already defined, you c...
php
{ "resource": "" }
q263211
ServiceDefinition.fromArray
test
public static function fromArray(array $serviceConfiguration) { if (!isset($serviceConfiguration['class'])) { throw new InvalidServiceException('The service configuration must define a "class" attribute.'); } // construct the service definition $defintion = new s...
php
{ "resource": "" }
q263212
ServiceDefinition.calls
test
public function calls(string $method, array $arguments = []) : ServiceDefinition { return $this->addMethodCall($method, new ServiceArguments($arguments)); }
php
{ "resource": "" }
q263213
ServiceDefinition.addMethodCall
test
public function addMethodCall(string $methodName, ServiceArguments $arguments) : ServiceDefinition { $this->methodCallers[] = [$methodName, $arguments]; return $this; }
php
{ "resource": "" }
q263214
ServiceDefinition.addMetaData
test
public function addMetaData(string $key, array $values) { if (!isset($this->metaData[$key])) { $this->metaData[$key] = []; } $this->metaData[$key][] = $values; return $this; }
php
{ "resource": "" }
q263215
Github.isOrigin
test
public function isOrigin() { // Correct IP range for Github maintained here: // https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist/ $hasGithubHeader = false !== strpos($this->request->header('User-Agent'), 'GitHub-Hookshot'); $hasGithubIp = $th...
php
{ "resource": "" }
q263216
Github.isAuthentic
test
public function isAuthentic() { // get the Github signature $xhub = $this->request->header('X-Hub-Signature') ?: 'nothing'; // reconstruct the hash on this side $hash = 'sha1='.hash_hmac('sha1', $this->request->getContent(), config('auto-deploy.secret')); // securely compar...
php
{ "resource": "" }
q263217
ParameterDefinitionNode.setValue
test
public function setValue(AssignableNode $value) { // we currently only allow Arrays & scalar values // it not yet possible assign a reference to a parameter if (!($value instanceof ValueNode || $value instanceof ArrayNode)) { throw new LogicalNodeException("It is not possible to ...
php
{ "resource": "" }
q263218
WorkoutType.getName
test
static function getName($id) { try { return self::TYPES_NAMES[$id]; } catch (\Exception $e) { throw new EndomondoWorkoutException('Unknown workout type', $e->getCode(), $e->getPrevious()); } }
php
{ "resource": "" }
q263219
Point.toString
test
public function toString() { if ($this->getTime() !== null) { $time = $this->getTime()->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s \U\T\C'); } else { $time = ''; } return $time . ';' . $this->getInstruction() . ';' . $th...
php
{ "resource": "" }
q263220
Webhook.send
test
public function send(): bool { $response = $this->client->request( 'POST', $this->client->getConfig('base_uri')->getPath(), $this->buildPayload() ); return $response->getStatusCode() === 200; }
php
{ "resource": "" }
q263221
Workout.setTypeId
test
public function setTypeId($id) { if (!WorkoutType::exist($id)) { throw new EndomondoWorkoutException('Unknown workout type'); }; $this->typeId = $id; return $this; }
php
{ "resource": "" }
q263222
Workout.getEnd
test
public function getEnd() { // if end property is defined, use it if ($this->end) { return clone $this->end; } $numberOfPosts = count($this->getPoints()); // try to find last time of point and use it as end date if ($this->haveGPSData()) { ret...
php
{ "resource": "" }
q263223
Workout.getPointsAsString
test
public function getPointsAsString() { $points = ''; foreach ($this->getPoints() as $point) { $points .= $point->toString(); } return $points; }
php
{ "resource": "" }
q263224
Workout.getGPX
test
public function getGPX() { // @TODO use some library to generate GPX files $xml = new \SimpleXMLElement( '<gpx xmlns="http://www.topografix.com/GPX/1/1" ' . 'xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" ' . '/>' ); $trk = ...
php
{ "resource": "" }
q263225
SlimResponseCollector.collect
test
function collect() { return [ 'content-type' => $this->response->header('Content-Type'), 'status_code' => $this->response->getStatus(), 'headers' => $this->getDataFormatter()->formatVar($this->response->headers->all()), 'cookies' => $this->getDataFormatter()->...
php
{ "resource": "" }
q263226
Builder.getModels
test
public function getModels($columns = ['*']) { $results = $this->query->get($columns); $connection = $this->model->getConnectionName(); // Check for joined relations if (!empty($this->joined)) { foreach ($results as $key => $result) { $relation_values = [...
php
{ "resource": "" }
q263227
Utility.get_ajax_payload
test
public static function get_ajax_payload( $handle = '' ) { $payload = null; if ( ! empty( $_POST['payload'] ) ) { $payload = $_POST['payload']; // Could be either a string or an array. } /** * Filter the Ajax payload. * * @param mixed $payload The ajax payload. * @param string $handle The curr...
php
{ "resource": "" }
q263228
Utility.get_callback_response
test
public static function get_callback_response( $handle, $callback, $callback_args ) { $ajax_payload = static::get_ajax_payload( $handle ); $response = static::run_callback( $callback, array( $ajax_payload, $callback_args, ) ); /** * Filter the callback response. * * @param mixed $re...
php
{ "resource": "" }
q263229
Utility.run_callback
test
public static function run_callback( $callback = '', $callback_args = array() ) { if ( ! is_callable( $callback ) ) { return null; } try { $result = call_user_func_array( $callback, $callback_args ); } catch ( \Exception $caught_exception ) { $result = $caught_exception; } return $result; }
php
{ "resource": "" }
q263230
Utility.sanitize_handle
test
public static function sanitize_handle( $handle = null ) { $handle = sanitize_key( $handle ); $handle = str_replace( '-', '_', $handle ); return $handle; }
php
{ "resource": "" }
q263231
Validator.validate_all
test
public function validate_all() { foreach ( (array) $this->registered_validations as $condition => $value ) { if ( ! $this->validate_single( $condition, $value ) ) { return false; } } return true; }
php
{ "resource": "" }
q263232
Validator.validate_single
test
private function validate_single( $condition, $value ) { $validator = array( $this->validations_class, $condition ); if ( is_callable( $validator ) ) { $result = call_user_func( $validator, $value ); } else { $result = false; } return (bool) $result; }
php
{ "resource": "" }
q263233
Column.forDevice
test
public function forDevice($device, $width, $offset = null, $push = null, $resets = false) { $this->sizes[$device] = array('width' => $width, 'offset' => $offset, 'push' => $push); if ($resets) { $this->addReset($device); } return $this; }
php
{ "resource": "" }
q263234
Column.addReset
test
public function addReset($device) { if (!in_array($device, $this->resets)) { $this->resets[] = $device; } return $this; }
php
{ "resource": "" }
q263235
Column.getSize
test
public function getSize($device) { if (isset($this->sizes[$device])) { return $this->sizes[$device]; } return null; }
php
{ "resource": "" }
q263236
Column.build
test
public function build() { $classes = array(); foreach ($this->sizes as $device => $size) { if ($size['width']) { $classes[] = sprintf('col-%s-%s', $device, $size['width']); } else { $classes[] = 'hidden-' . $device; } ...
php
{ "resource": "" }
q263237
Validations.user_is
test
public function user_is( $role ) { if ( ! is_user_logged_in() ) { return false; } $user = wp_get_current_user(); return in_array( $role, $user->roles ); }
php
{ "resource": "" }
q263238
Walker.begin
test
public function begin() { $this->index = 0; $this->infiniteIndex++; if ($this->classesOnly) { return $this->grid->getColumnAsString($this->index); } return sprintf( '%s%s%s<div class="%s">%s', $this->beginRow(), PHP_EOL, ...
php
{ "resource": "" }
q263239
Walker.column
test
public function column() { $this->index++; $this->infiniteIndex++; if (!$this->grid->hasColumn($this->index)) { $this->index = 0; } if ($this->classesOnly) { return $this->grid->getColumnAsString($this->index); } $buffer = sprintf( ...
php
{ "resource": "" }
q263240
Walker.walk
test
public function walk() { if ($this->index < 0) { return $this->begin(); } if (!$this->grid->hasColumn($this->index + 1)) { return $this->end() . $this->begin(); } return $this->column(); }
php
{ "resource": "" }
q263241
Walker.beginRow
test
public function beginRow() { if ($this->classesOnly) { return trim('row ' . $this->grid->getRowClass()); } return sprintf('<div class="%s">', trim('row ' . $this->grid->getRowClass())); }
php
{ "resource": "" }
q263242
Walker.getColumnResets
test
public function getColumnResets($tag = null) { if (!$this->infinite || $this->infiniteIndex === 0 || $this->grid->hasColumn($this->infiniteIndex)) { return $this->grid->getColumnResetsAsString($this->index, $tag); } $number = count($this->grid->getColumns()); return $th...
php
{ "resource": "" }
q263243
Walker.getIndex
test
public function getIndex($ignoreInfinite = false) { if ($this->infinite && !$ignoreInfinite) { return $this->infiniteIndex; } return $this->index; }
php
{ "resource": "" }
q263244
migrate.migrateFromLegacy
test
private function migrateFromLegacy() { if (!$this->database->fieldExists('bootstrap_grid', 'tl_content') && $this->database->fieldExists('columnset_id', 'tl_content') ) { $this->database->query( 'ALTER TABLE tl_content ADD bootstrap_grid int(10) unsigned NOT N...
php
{ "resource": "" }
q263245
Handler.handle
test
public function handle( $handle ) { // Sanitize the handle name. $this->handle = $this->utility->sanitize_handle( $handle ); // Register this handle with the frontend class. $this->frontend->register_handle( $this->handle ); // Register the Ajax handler in the WordPress hook system. add_action( 'wp_ajax_...
php
{ "resource": "" }
q263246
Handler.ajax_handler
test
public function ajax_handler() { if ( $this->utility->validate_nonce( $this->handle ) && $this->validator->validate_all() ) { $callback_response = $this->utility->get_callback_response( $this->handle, $this->handle_callback, $this->handle_callback_args ); $this->responder->handle_response( $callback_response ...
php
{ "resource": "" }
q263247
Handler.with_callback
test
public function with_callback( $callback = '', $callback_args = array() ) { $this->handle_callback = $callback; $this->handle_callback_args = $callback_args; return $this; }
php
{ "resource": "" }
q263248
Handler.with_validation
test
public function with_validation( $validations = array() ) { foreach ( (array) $validations as $condition => $value ) { $this->validator->add_validation( $condition, $value ); } return $this; }
php
{ "resource": "" }
q263249
Responder.handle_response
test
public function handle_response( $callback_response ) { $this->callback_response = $callback_response; $this->response_type = $this->get_response_type(); $this->send_response_headers(); $this->send_response_body(); }
php
{ "resource": "" }
q263250
Responder.get_response_type
test
protected function get_response_type() { if ( is_array( $this->callback_response ) ) { $response_type = 'json'; } elseif ( is_string( $this->callback_response ) ) { $response_type = 'plain'; } else { // For everything else, i.e. null, WP_Error object, caught exception, etc. $response_type = 'error'...
php
{ "resource": "" }
q263251
Responder.send_response_headers
test
protected function send_response_headers() { $http_content_type = 'text/plain'; // Set an HTTP error code if the response type is an error. if ( 'error' === $this->response_type ) { http_response_code( 500 ); // Internal server error. } // Set the content type to JSON if the callback response is an arra...
php
{ "resource": "" }
q263252
Responder.send_response_body
test
protected function send_response_body() { if ( 'json' === $this->response_type ) { $response_json = wp_json_encode( $this->callback_response ); if ( false !== $response_json ) { echo $response_json; } } elseif ( 'plain' === $this->response_type ) { echo $this->callback_response; } }
php
{ "resource": "" }
q263253
GeoIP2Adapter.getContent
test
public function getContent(string $url): string { if (false === filter_var($url, FILTER_VALIDATE_URL)) { throw new InvalidArgument( sprintf('"%s" must be called with a valid url. Got "%s" instead.', __METHOD__, $url) ); } $ipAddress = parse_url($url, ...
php
{ "resource": "" }
q263254
GeoIP2Adapter.isSupportedGeoIP2Model
test
protected function isSupportedGeoIP2Model(string $method): bool { $availableMethods = [ self::GEOIP2_MODEL_CITY, self::GEOIP2_MODEL_COUNTRY, ]; return in_array($method, $availableMethods); }
php
{ "resource": "" }
q263255
ToggleIconCallback.toggleVisibility
test
private function toggleVisibility($recordId, $newState) { if (!$this->hasAccess()) { $this->log( sprintf('Not enough permission to show/shide record ID "%s"', $recordId), __METHOD__, TL_ERROR ); $this->redirect('contao/main...
php
{ "resource": "" }
q263256
ToggleIconCallback.hasAccess
test
private function hasAccess() { if ($this->user instanceof \BackendUser) { return $this->user->hasAccess($this->table . '::' . $this->column, 'alexf'); } return false; }
php
{ "resource": "" }
q263257
GridBuilder.build
test
public function build() { $grid = new Grid(); foreach ($this->columns as $index => $column) { $grid->addColumn($column->build()); $grid->addColumnResets($index, $column->getResets()); } return $grid; }
php
{ "resource": "" }
q263258
Grid.getColumnAsString
test
public function getColumnAsString($index) { if (isset($this->columns[$index])) { return implode(' ', $this->columns[$index]); } return ''; }
php
{ "resource": "" }
q263259
Grid.addColumnReset
test
public function addColumnReset($column, $size) { if (!isset($this->columnResets[$column])) { $this->columnResets[$column] = array(); } if (!in_array($size, $this->columnResets[$column])) { $this->columnResets[$column][] = $size; } return $this; }
php
{ "resource": "" }
q263260
Grid.addColumnResets
test
public function addColumnResets($column, array $sizes) { if (!isset($this->columnResets[$column])) { $this->columnResets[$column] = $sizes; } else { $this->columnResets[$column] = array_unique(array_merge($this->columnResets[$column], $sizes)); } return $this...
php
{ "resource": "" }
q263261
Grid.getColumnResets
test
public function getColumnResets($index) { $index = intval($index); if (isset($this->columnResets[$index])) { return $this->columnResets[$index]; } return array(); }
php
{ "resource": "" }
q263262
Grid.hasColumnResetForSize
test
public function hasColumnResetForSize($column, $size) { if (!isset($this->columnResets[$column])) { return false; } return in_array($size, $this->columnResets[$column]); }
php
{ "resource": "" }
q263263
Grid.getColumnResetsAsString
test
public function getColumnResetsAsString($index, $tag = null) { $tag = $tag ?: 'div'; return implode( PHP_EOL, array_map( function ($item) use ($tag) { return sprintf( '<%s class="clearfix visible-%s-block"></%s>' . ...
php
{ "resource": "" }
q263264
Frontend.register_handle
test
public function register_handle( $handle = '' ) { $this->registered_handles[] = $handle; // Only call add_actions() the first time a handle is registered, as the actions will still be registered for // subsequent handles. if ( 1 === count( $this->registered_handles ) ) { $this->add_actions(); } }
php
{ "resource": "" }
q263265
Frontend.enqueue_scripts
test
public function enqueue_scripts() { if ( empty( $this->registered_handles ) ) { return; } $script_url = plugin_dir_url( trailingslashit( __DIR__ ) . '../../../' ) . 'assets/js/wp-ajax-helper.js'; wp_enqueue_script( 'wp-ajax-helper', $script_url, array( 'jquery' ), null, true ); wp_localize_script( '...
php
{ "resource": "" }
q263266
Frontend.get_nonces
test
protected function get_nonces() { $nonces = array(); foreach ( (array) $this->registered_handles as $handle ) { $nonces[ $handle ] = wp_create_nonce( $handle ); } return $nonces; }
php
{ "resource": "" }
q263267
SemanticHtml5.getGrids
test
public static function getGrids(GetGridsEvent $event) { $model = $event->getModel(); $grids = $event->getGrids(); if ($model->type == 'semantic_html5') { $query = 'SELECT * FROM tl_columnset WHERE published=1 ORDER BY title'; $result = \Database::getInstance()->quer...
php
{ "resource": "" }
q263268
SemanticHtml5.hookParseTemplate
test
public function hookParseTemplate(\Template $template) { if (substr($template->getName(), 0, 3) != 'ce_' || $template->type != 'semantic_html5' || $template->sh5_tag != 'start' ) { return; } $this->createRow($template); $this->createColumn...
php
{ "resource": "" }
q263269
SemanticHtml5.hookGetContentElement
test
public function hookGetContentElement($model, $buffer) { if ($model->type === 'semantic_html5' && $model->sh5_tag === 'start' && $model->bootstrap_isGridElement === 'column' && static::$grids[$model->bootstrap_gridRow] ) { $row = $model->bootstrap_gri...
php
{ "resource": "" }
q263270
SemanticHtml5.getGridElements
test
public function getGridElements($dataContainer) { $elements = array(); if ($dataContainer->activeRecord) { $query = <<<SQL SELECT c.*, g.title as gridTitle, g.columns as gridColumns FROM tl_content c LEFT JOIN tl_columnset g ON g.id = c.bootstrap_grid WHERE (c.ptable...
php
{ "resource": "" }
q263271
SemanticHtml5.createRow
test
private function createRow($template) { // semantic html5 element is marked as beginning of new grid row if ($template->bootstrap_isGridElement == 'row') { try { static::$grids[$template->id] = Factory::createById($template->bootstrap_grid); static::$count...
php
{ "resource": "" }
q263272
SemanticHtml5.createColumn
test
private function createColumn($template) { // semantic html5 element is marked as an grid column if ($template->bootstrap_isGridElement == 'column') { if (static::$grids[$template->bootstrap_gridRow]) { $row = $template->bootstrap_gridRow; $grid = stati...
php
{ "resource": "" }
q263273
Factory.buildGridColumns
test
private static function buildGridColumns($builder, $result, $classes) { $columns = $result->columns; $sizes = deserialize($result->sizes, true); for ($i = 0; $i < $columns; $i++) { $column = $builder->addColumn(); foreach ($sizes as $size) { $key ...
php
{ "resource": "" }
q263274
Factory.fetchResult
test
private static function fetchResult($gridId, $ignoreError = false) { $result = \Database::getInstance() ->prepare('SELECT * FROM tl_columnset WHERE id=? AND published=1') ->limit(1) ->execute($gridId); if (!$ignoreError && $result->numRows < 1) { thro...
php
{ "resource": "" }
q263275
Factory.prepareClasses
test
private static function prepareClasses($result) { $classes = array(); foreach (deserialize($result->customClasses, true) as $class) { $classes[$class['column']] = $class['class']; } return $classes; }
php
{ "resource": "" }
q263276
Factory.buildColumnResets
test
private static function buildColumnResets($result, $grid) { foreach (deserialize($result->resets, true) as $row) { foreach (array('xs', 'sm', 'md', 'lg') as $size) { if (isset($row[$size]) && $row[$size]) { $grid->addColumnReset(($row['column'] - 1), $size); ...
php
{ "resource": "" }
q263277
Factory.createById
test
public static function createById($gridId, $ignoreError = false) { if (isset(static::$cache[$gridId])) { return static::$cache[$gridId]; } $result = self::fetchResult($gridId, $ignoreError); if ($result) { $builder = GridBuilder::create(); ...
php
{ "resource": "" }
q263278
Subcolumns.hookParseTemplate
test
public function hookParseTemplate(\Template $template) { if (TL_MODE == 'BE' && $template->getName() == 'be_subcolumns' && Bootstrap::getConfigVar('grid-editor.backend.replace-subcolumns-template') ) { $template->setName('be_subcolumns_bootstrap'); } }
php
{ "resource": "" }
q263279
Subcolumns.hookIsVisibleElement
test
public function hookIsVisibleElement(\Model $model, $isVisible) { if (static::isActive() && ( ($model->getTable() == 'tl_module' && $model->type == 'subcolumns') || $model->getTable() == 'tl_content' && ($model->type == 'colsetStart' || $model->type == 'colsetPart' ...
php
{ "resource": "" }
q263280
Subcolumns.hookLoadFormField
test
public function hookLoadFormField($widget) { if ($widget->type === 'formcolstart') { $type = $widget->fsc_type; $gridId = $widget->bootstrap_grid; $grid = Factory::createById($gridId); $GLOBALS['TL_SUBCL'][static::$name]['sets'][$type] = $this->prepareCon...
php
{ "resource": "" }
q263281
Subcolumns.getGrids
test
public static function getGrids(GetGridsEvent $event) { $model = $event->getModel(); $grids = $event->getGrids(); if ($model->type == 'colsetStart' || $model->type == 'subcolumns') { $query = 'SELECT * FROM tl_columnset WHERE published=1 AND columns=? ORDER BY title'; ...
php
{ "resource": "" }
q263282
Subcolumns.prepareContainer
test
protected function prepareContainer(Grid $grid) { $container = array(); foreach ($grid->getColumns() as $column) { $container[] = array(implode(' ', $column)); } return $container; }
php
{ "resource": "" }
q263283
Subcolumns.updateSubcolumnsDefinition
test
private function updateSubcolumnsDefinition($gridId, $type) { $grid = Factory::createById($gridId); $GLOBALS['TL_SUBCL'][static::$name]['sets'][$type] = $this->prepareContainer($grid); if ($grid->getRowClass()) { $GLOBALS['TL_SUBCL'][static::$name]['scclass'] = 'row ' . $grid->...
php
{ "resource": "" }
q263284
ColumnSet.appendColumnsetIdToPalette
test
public function appendColumnsetIdToPalette($dataContainer) { if ($GLOBALS['TL_CONFIG']['subcolumns'] != 'bootstrap_customizable') { return; } if ($dataContainer->table == 'tl_content') { $model = \ContentModel::findByPK($dataContainer->id); if ($model->s...
php
{ "resource": "" }
q263285
ColumnSet.appendColumnSizesToPalette
test
public function appendColumnSizesToPalette($dataContainer) { $model = \Database::getInstance() ->prepare('SELECT * FROM tl_columnset WHERE id=?') ->limit(1) ->execute($dataContainer->id); $sizes = array_merge(deserialize($model->sizes, true)); foreach ($...
php
{ "resource": "" }
q263286
ColumnSet.getAllTypes
test
public function getAllTypes() { if ($GLOBALS['TL_CONFIG']['subcolumns'] != 'bootstrap_customizable') { return array_keys($GLOBALS['TL_SUBCL'][$GLOBALS['TL_CONFIG']['subcolumns']]['sets']); } $this->import('Database'); $collection = $this->Database->execute('SELECT column...
php
{ "resource": "" }
q263287
ColumnSet.getGrids
test
public function getGrids($dataContainer) { if ($dataContainer->activeRecord) { $dispatcher = $GLOBALS['container']['event-dispatcher']; $event = new GetGridsEvent($dataContainer->activeRecord); $dispatcher->dispatch(GetGridsEvent::NAME, $event); return $...
php
{ "resource": "" }
q263288
ColumnSet.getColumnsForModule
test
public function getColumnsForModule($dataContainer) { if ($GLOBALS['TL_CONFIG']['subcolumns'] != 'bootstrap_customizable') { $subcolumns = new \tl_module_sc(); return $subcolumns->getColumns($dataContainer); } $model = \ModuleModel::findByPK($dataContainer->currentR...
php
{ "resource": "" }
q263289
ColumnSet.getColumnOrders
test
public function getColumnOrders() { $columns = Bootstrap::getConfigVar('grid-editor.columns'); $values = array(); for ($i = 0; $i <= $columns; $i++) { $values['push'][] = 'push-' . $i; $values['pull'][] = 'pull-' . $i; } return $values; }
php
{ "resource": "" }
q263290
ColumnSet.getColumnNumbers
test
public function getColumnNumbers($dataContainer) { if ($dataContainer->activeRecord) { $columns = $dataContainer->activeRecord->columns; } else { $columns = Bootstrap::getConfigVar('grid-editor.columns'); } $values = range(1, $columns); return $value...
php
{ "resource": "" }
q263291
Flash.get
test
public function get(string $key, $default = null) { if (array_key_exists($key, $this->data)) { return $this->data[$key]; } return array_key_exists($key, $this->session) ? $this->session[$key] : $default; }
php
{ "resource": "" }
q263292
Flash.has
test
public function has(string $key): bool { return array_key_exists($key, $this->data) || array_key_exists($key, $this->session); }
php
{ "resource": "" }
q263293
Flash.delete
test
public function delete(string $key): self { unset($this->data[$key]); unset($this->session[$key]); return $this; }
php
{ "resource": "" }
q263294
Flash.load
test
public function load(string $key, callable $callback) { if (!$this->has($key)) { $this->set($key, $callback($key)); } return $this->get($key); }
php
{ "resource": "" }
q263295
Flash.reflash
test
public function reflash(array $keys = null): self { if ($keys === null) { return $this->clear($this->data + $this->session); } $session = array_intersect_key($this->session, array_flip($keys)); return $this->clear($this->data + $session); }
php
{ "resource": "" }
q263296
InsertTag.parseInsertTag
test
public function parseInsertTag(ReplaceInsertTagsEvent $event) { if ($event->getTag() != 'grid') { return; } if (TL_MODE !== 'FE') { $event->setHtml(sprintf('[[%s]]', $event->getRaw())); return; } $walker = $this->getWalker($event); ...
php
{ "resource": "" }
q263297
InsertTag.getWalker
test
private function getWalker(ReplaceInsertTagsEvent $event) { $identifier = $event->getParam(0); if (!isset(static::$walkers[$identifier])) { list($columnSetId, $infinite) = $this->translateParams($event); try { static::$walkers[$identifier] = new Walker(Facto...
php
{ "resource": "" }
q263298
InsertTag.translateParams
test
private function translateParams(ReplaceInsertTagsEvent $event) { $infinite = false; $columnSetId = $event->getParam(0); if ($event->getParam(1) === 'begin' && $event->getParam(2)) { $columnSetId = $event->getParam(2); if ($event->getParam(3)) { $...
php
{ "resource": "" }
q263299
GestPayCryptWS.getEncParams
test
private function getEncParams() { // Parametri obbligatori $params = array( 'shopLogin' => $this->getShopLogin(), 'uicCode' => $this->getCurrency(), 'amount' => $this->getAmount(), 'shopTransactionId' => $this->getShopTransactionID(), ); ...
php
{ "resource": "" }