_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10800 | Smarty_CacheResource_Mysql.delete | train | protected function delete($name, $cache_id, $compile_id, $exp_time)
{
// delete the whole cache
if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) {
// returning the number of deleted caches would require a second query to count them
$quer... | php | {
"resource": ""
} |
q10801 | Iframe.render | train | public function render($src, $class = '', $id = '', array $attrs = array())
{
$attrs = array_merge(array(
'frameborder' => 0,
'content' => null,
'tag' => 'iframe',
'src' => Str::trim($src)
), $attrs);
$attrs = $this->_cle... | php | {
"resource": ""
} |
q10802 | BestCheckpoints.onLocalRecordsLoaded | train | public function onLocalRecordsLoaded($records, BaseRecords $baseRecords)
{
if (!$this->checkRecordPlugin($baseRecords)) {
return;
}
if (count($records) > 0) {
$this->updater->setLocalRecord($records[0]->getPlayer()->getNickname(), $records[0]->getCheckpoints());
... | php | {
"resource": ""
} |
q10803 | RokkaFormatter.formatStackOperationOptions | train | public function formatStackOperationOptions(array $settings)
{
$data = [];
foreach ($settings as $name => $value) {
$data[] = $name.':'.$value;
}
return implode(' | ', $data);
} | php | {
"resource": ""
} |
q10804 | RokkaFormatter.outputImageInfo | train | public function outputImageInfo(SourceImage $sourceImage, OutputInterface $output)
{
$output->writeln([
' Hash: <info>'.$sourceImage->hash.'</info>',
' Organization: <info>'.$sourceImage->organization.'</info>',
' Name: <info>'.$sourceImage->name.'</info>',
... | php | {
"resource": ""
} |
q10805 | RokkaFormatter.outputOrganizationInfo | train | public function outputOrganizationInfo(Organization $org, OutputInterface $output)
{
$output->writeln([
' ID: <info>'.$org->getId().'</info>',
' Name: <info>'.$org->getName().'</info>',
' Display Name: <info>'.$org->getDisplayName().'</info>',
' Billing eM... | php | {
"resource": ""
} |
q10806 | RokkaFormatter.outputOrganizationMembershipInfo | train | public function outputOrganizationMembershipInfo(Membership $membership, OutputInterface $output)
{
$output->writeln([
' ID: <info>'.$membership->userId.'</info>',
' Roles: <info>'.json_encode($membership->roles).'</info>',
' Active: <info>'.($membership->active ? 'Tru... | php | {
"resource": ""
} |
q10807 | RokkaFormatter.outputStackInfo | train | public function outputStackInfo(Stack $stack, OutputInterface $output)
{
$output->writeln(' Name: <info>'.$stack->getName().'</info>');
$output->writeln(' Created: <info>'.$stack->getCreated()->format('Y-m-d H:i:s').'</info>');
$operations = $stack->getStackOperations();
if (!empt... | php | {
"resource": ""
} |
q10808 | RokkaFormatter.outputUserInfo | train | public function outputUserInfo(User $user, OutputInterface $output)
{
$output->writeln([
' ID: <info>'.$user->getId().'</info>',
' eMail: <info>'.$user->getEmail().'</info>',
' API-Key: <info>'.$user->getApiKey().'</info>',
]);
} | php | {
"resource": ""
} |
q10809 | RokkaFormatter.formatDynamicMetadata | train | private function formatDynamicMetadata(DynamicMetadataInterface $metadata)
{
$info = null;
switch ($metadata::getName()) {
case SubjectArea::getName():
$data = [];
/* @var SubjectArea $metadata */
foreach (['x', 'y', 'width', 'height'] as $... | php | {
"resource": ""
} |
q10810 | Link.attachAgent | train | private function attachAgent(): void
{
$this->agentName = strtolower((string) $this->config['agent']);
switch ($this->agentName) {
case self::AGENT_MYSQL:
$this->agent = new Mysql($this->config);
break;
case self::AGENT_PGSQL:
$... | php | {
"resource": ""
} |
q10811 | Sample.actionCreateObject | train | protected function actionCreateObject()
{
$blockCenter = new XmlBlockCollection($this->_myWords->Value("OBJECT"), BlockPosition::Center);
$breakLine = new XmlnukeBreakLine();
$firstParagraph = new XmlParagraphCollection();
$firstParagraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("OBJECTTEXT1"... | php | {
"resource": ""
} |
q10812 | Ownable.isOwnedBy | train | public function isOwnedBy(Model $owner)
{
if ( ! $this->hasOwner())
{
return false;
}
return ($owner->getKey() === $this->owner->getKey());
} | php | {
"resource": ""
} |
q10813 | Map.getCurrentRoute | train | public static function getCurrentRoute()
{
$current = null;
$request = Request::current();
$routeStr = $request->getRouteStr();
$method = $request->getMethod();
//Search for the route
foreach (self::$routes as $route) {
//Check the method
if (... | php | {
"resource": ""
} |
q10814 | ResponseFormatter.format | train | public static function format($phantomJsResponse)
{
$response = new Response(
$phantomJsResponse->getStatus(),
$phantomJsResponse->getHeaders(),
$phantomJsResponse->getContent()
);
return $response;
} | php | {
"resource": ""
} |
q10815 | MimeTypeFileBinaryGuesser.guess | train | public static function guess(string $path, string $cmd = null): ?string
{
if (! \is_file($path)) {
throw new FileNotFoundException($path);
}
if (! \is_readable($path)) {
throw new AccessDeniedException($path);
}
if ($cmd === null) {
$cmd ... | php | {
"resource": ""
} |
q10816 | SlimData.addVariable | train | public function addVariable(string $name, ?string $type, ?bool $dynamic): KBEntry
{
$kbe = new KBEntry($name, $type, $dynamic);
$this->vars[] = $kbe;
return $kbe;
} | php | {
"resource": ""
} |
q10817 | SessionBuilder.build | train | public function build()
{
if ($this->handler) {
$handler = $this->handler;
} elseif ($this->pdo || $this->dbCredentials) {
$options = $this->dbCredentials;
$options['table'] = $this->table;
if ($this->pdo) {
$options['pdo'] = $this->pdo... | php | {
"resource": ""
} |
q10818 | Metadata.mergedWith | train | public function mergedWith(Metadata $additionalMetadata): self
{
$values = array_merge($this->values, $additionalMetadata->values);
if ($values === $this->values) {
return $this;
}
return new static($values);
} | php | {
"resource": ""
} |
q10819 | Metadata.withoutKeys | train | public function withoutKeys(array $keys): self
{
$values = array_diff_key($this->values, array_flip($keys));
if ($values === $this->values) {
return $this;
}
return new static($values);
} | php | {
"resource": ""
} |
q10820 | Number.toReadableSize | train | public static function toReadableSize($bytes, $decimals = 1, $system = 'metric')
{
$mod = ($system === 'binary') ? 1024 : 1000;
$units = [
'binary' => [
'B',
'KiB',
'MiB',
'GiB',
'TiB',
'PiB'... | php | {
"resource": ""
} |
q10821 | Number.toReadableTime | train | public static function toReadableTime($time, $decimals = 3)
{
$decimals = (int) $decimals;
$unit = 'sec';
return sprintf("%.{$decimals}f %s", $time, $unit);
} | php | {
"resource": ""
} |
q10822 | PlayersWindow.getIgnoredStatus | train | private function getIgnoredStatus($login)
{
try {
$ignoreList = $this->factory->getConnection()->getIgnoreList();
foreach ($ignoreList as $player) {
if ($player->login === $login) {
return true;
}
}
return f... | php | {
"resource": ""
} |
q10823 | Hidden.group | train | public function group(array $fields)
{
$output = array();
foreach ($fields as $name => $data) {
if (is_array($data)) {
list($data, $value, $class, $id) = $this->_findMainAttr($data);
$output[] = $this->render($name, $value, $class, $id, $data);
... | php | {
"resource": ""
} |
q10824 | MigrateUserFieldsTask.migrateFields | train | private function migrateFields()
{
if ($attendeeFields = AttendeeExtraField::get()) {
foreach ($attendeeFields as $attendeeField) {
$this->findOrMakeUserFieldFor($attendeeField);
}
}
} | php | {
"resource": ""
} |
q10825 | MigrateUserFieldsTask.findOrMakeUserFieldFor | train | private function findOrMakeUserFieldFor(AttendeeExtraField $attendeeField)
{
if (!$field = $this->getUserFields()->byID($attendeeField->ID)) {
/** @var UserField $field */
$class = self::mapFieldType($attendeeField->FieldType, $attendeeField->FieldName);
$field = $class::... | php | {
"resource": ""
} |
q10826 | MigrateUserFieldsTask.findOrMakeUserOptionFor | train | private function findOrMakeUserOptionFor(AttendeeExtraFieldOption $attendeeOption)
{
if (!$option = $this->getUserFieldOption()->byID($attendeeOption->ID)) {
$option = UserFieldOption::create();
}
$option->ID = $attendeeOption->ID;
$option->Title = $attendeeOption->Title... | php | {
"resource": ""
} |
q10827 | MigrateUserFieldsTask.mapFieldType | train | private static function mapFieldType($type, $name = null)
{
$types = array(
'TextField' => 'UserTextField',
'EmailField' => 'UserEmailField',
'CheckboxField' => 'UserCheckboxField',
'OptionsetField' => 'UserOptionSetField'
);
$currentDefaults ... | php | {
"resource": ""
} |
q10828 | VoteService.update | train | public function update()
{
if ($this->currentVote) {
$vote = $this->currentVote->getCurrentVote();
$this->currentVote->update(time());
switch ($vote->getStatus()) {
case Vote::STATUS_CANCEL:
$this->dispatcher->dispatch("votemanager.vot... | php | {
"resource": ""
} |
q10829 | VoteService.startVote | train | public function startVote(Player $player, $typeCode, $params)
{
if ($this->getCurrentVote() !== null) {
$this->chatNotification->sendMessage("expansion_votemanager.error.in_progress");
return;
}
if (isset($this->voteMapping[$typeCode])) {
$typeCode = $thi... | php | {
"resource": ""
} |
q10830 | EloquentJournalEntry.byAccountIds | train | public function byAccountIds($ids, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalEntry->setConnection($databaseConnectionName)->whereIn('account_id', $ids)->get();
} | php | {
"resource": ""
} |
q10831 | EloquentJournalEntry.getJournalEntriesGroupedByPlBsCategoryByOrganizationAndByFiscalYear | train | public function getJournalEntriesGroupedByPlBsCategoryByOrganizationAndByFiscalYear($plBsCategory, $organizationId, $fiscalYearId, $databaseConnectionName = null)
{
// $this->DB->connection()->enableQueryLog();
// $Entries = $this->DB->table('ACCT_Journal_Entry AS je')
// ->join('ACCT_Journal_Vou... | php | {
"resource": ""
} |
q10832 | ButtonAbstract._getBtnClasses | train | protected function _getBtnClasses(array $attrs = array())
{
if (Arr::key('button', $attrs)) {
$classes = array($this->_btm);
foreach ((array) $attrs['button'] as $btn) {
$classes[] = $this->_btm . '-' . $btn;
}
$attrs = $this->_mergeAttr($attr... | php | {
"resource": ""
} |
q10833 | Config.get | train | public static function get( $key = null ) {
$path = apply_filters(
'inc2734_view_controller_config_path',
untrailingslashit( __DIR__ ) . '/../config/config.php'
);
if ( ! file_exists( $path ) ) {
return;
}
$config = include( $path );
if ( is_null( $key ) ) {
return $config;
}
if ( ! isse... | php | {
"resource": ""
} |
q10834 | BaseRecords.startMap | train | public function startMap($map, $nbLaps)
{
// Load firs X records for this map.
$this->recordsHandler->loadForMap($map->uId, $nbLaps);
// Load time information for remaining players.
$this->recordsHandler->loadForPlayers($map->uId, $nbLaps, $this->allPlayersGroup->getLogins());
... | php | {
"resource": ""
} |
q10835 | BaseRecords.dispatchEvent | train | public function dispatchEvent($eventData)
{
$event = $this->eventPrefix.'.'.$eventData['event'];
unset($eventData['event']);
$eventData[RecordHandler::COL_PLUGIN] = $this;
$this->dispatcher->dispatch($event, [$eventData]);
} | php | {
"resource": ""
} |
q10836 | AggregateRootTrait.registerEvent | train | protected function registerEvent($payload, $metadata = null)
{
if ($payload instanceof AbstractDomainEvent && null === $payload->aggregateId) {
$payload->setAggregateId($this->getId());
}
return $this->getEventContainer()
->addEvent($payload, $metadata);
} | php | {
"resource": ""
} |
q10837 | AssetBundle.registerAssetFiles | train | public function registerAssetFiles($view)
{
if (YII_ENV_PROD) {
if (!empty($this->productionJs)) {
$this->js = $this->productionJs;
}
if (!empty($this->productionCss)) {
$this->css = $this->productionCss;
}
}
par... | php | {
"resource": ""
} |
q10838 | FtpClient.login | train | public function login(string $user, string $password, $attempts = 1, $sleepBetweenAttempts = 5)
{
if (!@ftp_login($this->ftp, $user, $password)) {
if (--$attempts > 0) {
sleep($sleepBetweenAttempts);
return $this->login($user, $password, $attempts, $sleepBetweenA... | php | {
"resource": ""
} |
q10839 | FtpClient.listFilesRaw | train | public function listFilesRaw(string $dir = ".", int $attempts = 5, int $sleepBetweenAttempts = 5)
{
$total = @ftp_rawlist($this->ftp, $dir);
if ($total === false) {
// Check if tries left call method again
if (--$attempts > 0) {
sleep($sleepBetweenAttempts);
... | php | {
"resource": ""
} |
q10840 | FtpClient.get | train | public function get(
string $remoteFile, string $localFile = null, int $mode = FTP_BINARY, int $attempts = 1,
int $sleepBetweenAttempts = 5
) {
if (!$localFile) {
$localFile = $remoteFile;
}
if (!@ftp_get($this->ftp, $localFile, $remoteFile, $mode)) {
... | php | {
"resource": ""
} |
q10841 | FtpClient.fget | train | public function fget(string $remoteFile, $handle, int $resumePos = 0)
{
if (!@ftp_fget($this->ftp, $handle, $remoteFile, FTP_BINARY, $resumePos)) {
throw new Exception("Cannot write in file handle");
}
return $this;
} | php | {
"resource": ""
} |
q10842 | FtpClient.passive | train | public function passive(bool $passive)
{
if (!@ftp_pasv($this->ftp, $passive)) {
throw new Exception(sprintf("Cannot switch to passive = %s", $passive ? "true" : "false"));
}
return $this;
} | php | {
"resource": ""
} |
q10843 | FtpClient.fput | train | public function fput(string $remoteFile, $handle, int $resumePos = 0)
{
if (!@ftp_fput($this->ftp, $remoteFile, $handle, FTP_BINARY, $resumePos)) {
throw new Exception(sprintf("Cannot copy data from file handle to %s", $remoteFile));
}
return $this;
} | php | {
"resource": ""
} |
q10844 | FtpClient.delete | train | public function delete(string $remoteFile)
{
if (!@ftp_delete($this->ftp, $remoteFile)) {
throw new Exception(sprintf("Cannot delete file %s", $remoteFile));
}
return $this;
} | php | {
"resource": ""
} |
q10845 | FtpClient.getSize | train | public function getSize(string $remoteFile)
{
$size = @ftp_size($this->ftp, $remoteFile);
if ($size == -1) {
throw new Exception("Cannot get file size");
}
return $size;
} | php | {
"resource": ""
} |
q10846 | FtpClient.getModifiedTimestamp | train | public function getModifiedTimestamp(string $remoteFile, int $attempts = 1, int $sleepBetweenAttempts = 5)
{
$timestamp = @ftp_mdtm($this->ftp, $remoteFile);
if ($timestamp < 0) {
if (--$attempts > 0) {
sleep($sleepBetweenAttempts);
return $this->getModi... | php | {
"resource": ""
} |
q10847 | Route.all | train | public static function all(
string $routeStr,
array $info
) {
$methods = Request::getValidMethods();
self::create($methods, $routeStr, $info);
} | php | {
"resource": ""
} |
q10848 | Route.create | train | public static function create(
array $methods,
string $routeStr,
array $info
) {
$middlewareList = isset($info['middleware']) ? (array) $info['middleware'] : [];
array_walk_recursive(
self::$middlewareGroupStack,
function ($middleware) use (&$middlewar... | php | {
"resource": ""
} |
q10849 | Route.delete | train | public static function delete(
string $routeStr,
array $info
) {
self::create([Request::METHOD_DELETE], $routeStr, $info);
} | php | {
"resource": ""
} |
q10850 | Route.get | train | public static function get(
string $routeStr,
array $info
) {
self::create([Request::METHOD_GET], $routeStr, $info);
} | php | {
"resource": ""
} |
q10851 | Route.group | train | public static function group(string $prefix, Closure $closure, $middleware = [])
{
$prefix = trim($prefix, self::SEPARATOR);
//Prepend prefixes
if ($prefix) {
self::$prefixGroupStack[] = $prefix;
}
//Add group middleware
if ($middleware) {
se... | php | {
"resource": ""
} |
q10852 | Route.post | train | public static function post(
string $routeStr,
array $info
) {
self::create([Request::METHOD_POST], $routeStr, $info);
} | php | {
"resource": ""
} |
q10853 | Route.patch | train | public static function patch(
string $routeStr,
array $info
) {
self::create([Request::METHOD_PATCH], $routeStr, $info);
} | php | {
"resource": ""
} |
q10854 | Route.put | train | public static function put(
string $routeStr,
array $info
) {
self::create([Request::METHOD_PUT], $routeStr, $info);
} | php | {
"resource": ""
} |
q10855 | Group.addLogin | train | public function addLogin($login)
{
if (!isset($this->logins[$login])) {
$this->logins[$login] = true;
$this->dispatcher->dispatch(self::EVENT_NEW_USER, [$this, $login]);
}
} | php | {
"resource": ""
} |
q10856 | Group.removeLogin | train | public function removeLogin($login)
{
if (isset($this->logins[$login])) {
unset($this->logins[$login]);
$this->dispatcher->dispatch(self::EVENT_REMOVE_USER, [$this, $login]);
}
if (!$this->isPersistent() && empty($this->logins)) {
$this->dispatcher->disp... | php | {
"resource": ""
} |
q10857 | VisitorMapper.add | train | public function add(array $data) {
try {
$document = (new Visitor($data))->toArray();
$this->collection->insert($document, ['w' => true]);
return new \MongoId($document['_id']);
}
catch (\MongoCursorException $e) {
throw new MongoMapperExceptio... | php | {
"resource": ""
} |
q10858 | ArrayToXML.buildXML | train | public function buildXML(array $data, $startElement = 'data')
{
if (!\is_array($data)) {
$err = 'Invalid variable type supplied, expected array not found on line ' . __LINE__ . ' in Class: ' . __CLASS__ . ' Method: ' . __METHOD__;
\trigger_error($err);
return false; //ret... | php | {
"resource": ""
} |
q10859 | ArrayToXML.writeEl | train | protected function writeEl(XMLWriter $xml, $data)
{
foreach ($data as $key => $value) {
if (\is_array($value) && !$this->isAssoc($value)) { //numeric array
foreach ($value as $itemValue) {
if (\is_array($itemValue)) {
$xml->startElement... | php | {
"resource": ""
} |
q10860 | ViewExtensionHelper._getActiveMenuPattern | train | protected function _getActiveMenuPattern($level = 0, $urlInfo = null) {
if (empty($urlInfo) || !is_array($urlInfo)) {
return false;
}
$level = (int)$level;
extract($urlInfo);
if (($level < 0) || ($level > 2)) {
$level = 0;
}
if ($level > 1) {
$action = 'index';
}
if ($level == 0) {
$user... | php | {
"resource": ""
} |
q10861 | ViewExtensionHelper._getActiveMenuPatterns | train | protected function _getActiveMenuPatterns($urlInfo = null) {
$deepLevelsActivePattern = $this->_getDeepLevelsActiveMenuPattern();
$activePatterns = [];
for ($activePatternLevel = 0; $activePatternLevel <= $deepLevelsActivePattern; $activePatternLevel++) {
$activePatterns[] = $this->_getActiveMenuPattern($activ... | php | {
"resource": ""
} |
q10862 | ViewExtensionHelper._prepareIconList | train | protected function _prepareIconList(array &$iconList) {
if (empty($iconList) || !is_array($iconList)) {
return;
}
foreach ($iconList as $i => &$iconListItem) {
if (is_array($iconListItem) && isAssoc($iconListItem)) {
foreach ($iconListItem as $topMenu => $subMenu) {
$subMenuList = '';
foreach... | php | {
"resource": ""
} |
q10863 | ViewExtensionHelper._parseCurrentUrl | train | protected function _parseCurrentUrl() {
$prefix = $this->request->param('prefix');
$plugin = $this->request->param('plugin');
$controller = $this->request->param('controller');
$action = $this->request->param('action');
$named = $this->request->param('named');
$pass = $this->request->param('pass');
$named... | php | {
"resource": ""
} |
q10864 | ViewExtensionHelper.getMenuList | train | public function getMenuList($iconList = null) {
$activeMenuUrl = $this->_View->get('activeMenuUrl');
$urlInfo = $this->_parseCurrentUrl();
if (!empty($activeMenuUrl) && is_array($activeMenuUrl)) {
$urlInfo = $activeMenuUrl + $urlInfo;
}
$activePatterns = $this->_getActiveMenuPatterns($urlInfo);
$deepLeve... | php | {
"resource": ""
} |
q10865 | ViewExtensionHelper.yesNo | train | public function yesNo($data = null) {
if ((bool)$data) {
$result = $this->_getOptionsForElem('yesNo.yes');
} else {
$result = $this->_getOptionsForElem('yesNo.no');
}
return $result;
} | php | {
"resource": ""
} |
q10866 | ViewExtensionHelper.popupModalLink | train | public function popupModalLink($title = null, $url = null, $options = []) {
$optionsDefault = $this->_getOptionsForElem('popupModalLink');
return $this->_createLink('modal-popover', $title, $url, $options, $optionsDefault);
} | php | {
"resource": ""
} |
q10867 | ViewExtensionHelper.confirmLink | train | public function confirmLink($title = null, $url = null, $options = []) {
$optionsDefault = $this->_getOptionsConfirmLink();
return $this->_createLink(null, $title, $url, $options, $optionsDefault);
} | php | {
"resource": ""
} |
q10868 | ViewExtensionHelper.confirmPostLink | train | public function confirmPostLink($title = null, $url = null, $options = []) {
if (empty($options)) {
$options = [];
} elseif (!is_array($options)) {
$options = [$options];
}
$optionsDefault = $this->_getOptionsConfirmLink();
$optionsDefault['role'] = 'post-link';
return $this->ExtBs3Form->postLink($t... | php | {
"resource": ""
} |
q10869 | ViewExtensionHelper._createLink | train | protected function _createLink($toggle = null, $title = null, $url = null, $options = [], $optionsDefault = []) {
if (empty($options)) {
$options = [];
}
if (empty($optionsDefault)) {
$optionsDefault = [];
}
if (!empty($toggle)) {
$options['data-toggle'] = $toggle;
}
if (!empty($optionsDefault))... | php | {
"resource": ""
} |
q10870 | ViewExtensionHelper.ajaxLink | train | public function ajaxLink($title, $url = null, $options = []) {
return $this->_createLink('ajax', $title, $url, $options);
} | php | {
"resource": ""
} |
q10871 | ViewExtensionHelper.requestOnlyLink | train | public function requestOnlyLink($title, $url = null, $options = []) {
return $this->_createLink('request-only', $title, $url, $options);
} | php | {
"resource": ""
} |
q10872 | ViewExtensionHelper.pjaxLink | train | public function pjaxLink($title, $url = null, $options = []) {
return $this->_createLink('pjax', $title, $url, $options);
} | php | {
"resource": ""
} |
q10873 | ViewExtensionHelper.lightboxLink | train | public function lightboxLink($title, $url = null, $options = []) {
return $this->_createLink('lightbox', $title, $url, $options);
} | php | {
"resource": ""
} |
q10874 | ViewExtensionHelper.paginationSortPjax | train | public function paginationSortPjax($key = null, $title = null, $options = []) {
if (empty($options)) {
$options = [];
} elseif (!is_array($options)) {
$options = [$options];
}
$optionsDefault = $this->_getOptionsForElem('paginationSortPjax.linkOpt');
if ($this->request->is('modal')) {
$optionsDefaul... | php | {
"resource": ""
} |
q10875 | ViewExtensionHelper.progressSseLink | train | public function progressSseLink($title, $url = null, $options = []) {
return $this->_createLink('progress-sse', $title, $url, $options);
} | php | {
"resource": ""
} |
q10876 | ViewExtensionHelper._getClassForElement | train | protected function _getClassForElement($elementClass = null) {
$elementClass = mb_strtolower((string)$elementClass);
$cachePath = 'ClassForElem.' . md5($elementClass);
$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
if (!empty($cached)) {
return $cached;
}
$result = '';
if (empty($ele... | php | {
"resource": ""
} |
q10877 | ViewExtensionHelper.getBtnClass | train | public function getBtnClass($btn = null) {
$btnClass = $this->_getClassForElement($btn);
if (!empty($btnClass)) {
$result = $btnClass;
} else {
$result = $this->_getClassForElement('btn-default');
}
return $result;
} | php | {
"resource": ""
} |
q10878 | ViewExtensionHelper.iconTag | train | public function iconTag($icon = null, $options = []) {
$icon = mb_strtolower((string)$icon);
$dataStr = serialize(compact('icon', 'options')) . '_' . $this->_currUIlang;
$cachePath = 'iconTag.' . md5($dataStr);
$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
if (!empty($cached)) {
return $... | php | {
"resource": ""
} |
q10879 | ViewExtensionHelper.buttonLink | train | public function buttonLink($icon = null, $btn = null, $url = null, $options = []) {
$result = '';
if (empty($icon)) {
return $result;
}
$title = '';
if ($icon === strip_tags($icon)) {
if ($this->_getClassForElement($icon)) {
$icon .= ' fa-fw';
}
$title = $this->iconTag($icon);
}
if (empty... | php | {
"resource": ""
} |
q10880 | ViewExtensionHelper.button | train | public function button($icon = null, $btn = null, $options = []) {
$result = '';
if (empty($icon)) {
return $result;
}
$title = '';
if ($icon === strip_tags($icon)) {
if ($this->_getClassForElement($icon)) {
$icon .= ' fa-fw';
}
$title = $this->iconTag($icon);
}
if (empty($title)) {
$t... | php | {
"resource": ""
} |
q10881 | ViewExtensionHelper.addUserPrefixUrl | train | public function addUserPrefixUrl($url = null) {
if (empty($url)) {
return $url;
}
$userPrefix = $this->Session->read('Auth.User.prefix');
if (empty($userPrefix)) {
return $url;
}
if (!is_array($url)) {
if (($url === '/') || (stripos($url, '/') === false)) {
return $url;
}
$url = Router:... | php | {
"resource": ""
} |
q10882 | ViewExtensionHelper.menuItemLabel | train | public function menuItemLabel($title = null) {
$result = '';
if (empty($title)) {
return $result;
}
$result = $this->Html->tag('span', $title, ['class' => 'menu-item-label visible-xs-inline']);
return $result;
} | php | {
"resource": ""
} |
q10883 | ViewExtensionHelper.menuItemLink | train | public function menuItemLink($icon = null, $title = null, $url = null, $options = [], $badgeNumber = 0) {
$result = '';
if (empty($icon) || empty($title)) {
return $result;
}
$caret = '';
if (empty($options) || !is_array($options)) {
$options = [];
}
$options['escape'] = false;
$options['title'] ... | php | {
"resource": ""
} |
q10884 | ViewExtensionHelper.menuActionLink | train | public function menuActionLink($icon = null, $titleText = null, $url = null, $options = []) {
$result = '';
if (empty($icon)) {
return $result;
}
if ($this->_getClassForElement($icon)) {
$icon .= ' fa-fw';
}
$iconClass = $this->_getClassForElement($icon);
if (empty($iconClass)) {
return $result;... | php | {
"resource": ""
} |
q10885 | ViewExtensionHelper.timeAgo | train | public function timeAgo($time = null, $format = null) {
if (empty($time)) {
$time = time();
}
if (empty($format)) {
$format = '%x %X';
}
$result = $this->Html->tag(
'time',
$this->Time->i18nFormat($time, $format),
[
'data-toggle' => 'timeago',
'datetime' => date('c', $this->Time->fromS... | php | {
"resource": ""
} |
q10886 | ViewExtensionHelper.getIconForExtension | train | public function getIconForExtension($extension = null) {
$extension = mb_strtolower((string)$extension);
$cachePath = 'IconForExtension.' . md5($extension);
$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
if (!empty($cached)) {
return $cached;
}
$result = 'far fa-file';
if (empty($ext... | php | {
"resource": ""
} |
q10887 | ViewExtensionHelper.truncateText | train | public function truncateText($text = null, $length = 0) {
$result = '';
if (empty($text)) {
return $result;
}
$text = (string)$text;
$length = (int)$length;
if ($length <= 0) {
$length = 50;
}
if (($text === h($text)) && (mb_strlen($text) <= $length)) {
return $text;
}
$truncateOpt = $th... | php | {
"resource": ""
} |
q10888 | ViewExtensionHelper.getFormOptions | train | public function getFormOptions($options = []) {
if (empty($options) || !is_array($options)) {
$options = [];
}
$optionsDefault = $this->_getOptionsForElem('form');
$result = $optionsDefault + $options;
return $result;
} | php | {
"resource": ""
} |
q10889 | ViewExtensionHelper._getLangForNumberText | train | protected function _getLangForNumberText($langCode = null) {
if (!is_object($this->_NumberTextLib)) {
return false;
}
$cachePath = 'lang_code_number_lib_' . md5(serialize(func_get_args()));
$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_LANG_CODE);
if (!empty($cached)) {
return $cached;
}
$... | php | {
"resource": ""
} |
q10890 | ViewExtensionHelper.numberText | train | public function numberText($number = null, $langCode = null) {
if (!is_object($this->_NumberTextLib)) {
return false;
}
$langNumb = $this->_getLangForNumberText($langCode);
return $this->_NumberTextLib->numberText($number, $langNumb);
} | php | {
"resource": ""
} |
q10891 | ViewExtensionHelper.barState | train | public function barState($stateData = null) {
$result = '';
if (!is_array($stateData)) {
$stateData = [];
}
if (empty($stateData)) {
$stateData = [
[
'stateName' => $this->showEmpty(null),
'stateId' => null,
'amount' => 0,
'stateUrl' => null,
]
];
}
$totalAmount = Hash... | php | {
"resource": ""
} |
q10892 | ViewExtensionHelper.listLastInfo | train | public function listLastInfo($lastInfo = null, $labelList = null, $controllerName = null, $actionName = null, $linkOptions = [], $length = 0) {
if (!is_array($lastInfo)) {
$lastInfo = [];
}
if (empty($labelList) && !empty($controllerName)) {
$labelList = Inflector::humanize(Inflector::underscore($controlle... | php | {
"resource": ""
} |
q10893 | ViewExtensionHelper.buttonsMove | train | public function buttonsMove($url = null, $useDrag = true, $glue = '', $useGroup = false) {
$result = '';
if (empty($url) || !is_array($url)) {
return $result;
}
$actions = [];
if ($useDrag) {
$actions[] = $this->_getOptionsForElem('buttonsMove.btnDrag');
}
$buttons = $this->_getOptionsForElem('butt... | php | {
"resource": ""
} |
q10894 | ViewExtensionHelper.buttonLoadMore | train | public function buttonLoadMore($targetSelector = null) {
$result = '';
if (empty($targetSelector)) {
$targetSelector = 'table tbody';
}
$hasNext = $this->Paginator->hasNext();
if (!$hasNext) {
$paginatorParams = $this->Paginator->params();
$count = (int)Hash::get($paginatorParams, 'count');
$reco... | php | {
"resource": ""
} |
q10895 | ViewExtensionHelper.buttonsPaging | train | public function buttonsPaging($targetSelector = null, $showCounterInfo = true, $useShowList = true, $useGoToPage = true, $useChangeNumLines = true) {
$showType = (string)$this->request->param('named.show');
if (mb_stripos($showType, 'list') === 0) {
$result = $this->buttonLoadMore($targetSelector);
} else {
... | php | {
"resource": ""
} |
q10896 | ViewExtensionHelper.menuHeaderPage | train | public function menuHeaderPage($headerMenuActions = null) {
$result = '';
if (empty($headerMenuActions)) {
return $result;
}
if (!is_array($headerMenuActions)) {
$headerMenuActions = [$headerMenuActions];
}
$headerMenuActionsPrep = '';
foreach ($headerMenuActions as $action) {
$actionOptions = ... | php | {
"resource": ""
} |
q10897 | ViewExtensionHelper.headerPage | train | public function headerPage($pageHeader = null, $headerMenuActions = null) {
$result = '';
if (empty($pageHeader)) {
return $result;
}
$pageHeader = (string)$pageHeader;
$pageHeader .= $this->menuHeaderPage($headerMenuActions);
return $this->Html->div('page-header well', $this->Html->tag('h2', $pageHead... | php | {
"resource": ""
} |
q10898 | ViewExtensionHelper.collapsibleList | train | public function collapsibleList($listData = [], $showLimit = 10, $listClass = 'list-unstyled', $listTag = 'ul') {
$result = '';
if (empty($listData)) {
return $result;
}
$showLimit = (int)$showLimit;
if ($showLimit < 1) {
return $result;
}
if (!empty($listClass)) {
$listClass = ' ' . $listClass... | php | {
"resource": ""
} |
q10899 | ViewExtensionHelper.addBreadCrumbs | train | public function addBreadCrumbs($breadCrumbs = null) {
if (empty($breadCrumbs) || !is_array($breadCrumbs)) {
return;
}
foreach ($breadCrumbs as $breadCrumbInfo) {
if (empty($breadCrumbInfo)) {
continue;
}
$link = null;
if (is_array($breadCrumbInfo)) {
$name = array_shift($breadCrumbInfo);
... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.