id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
33,900 | silverorange/swat | Swat/SwatButton.php | SwatButton.getInputTag | protected function getInputTag()
{
// We do not use a 'button' element because it is broken differently in
// different versions of Internet Explorer
$tag = new SwatHtmlTag('input');
$tag->type = 'submit';
$tag->name = $this->id;
$tag->id = $this->id;
$tag->... | php | protected function getInputTag()
{
// We do not use a 'button' element because it is broken differently in
// different versions of Internet Explorer
$tag = new SwatHtmlTag('input');
$tag->type = 'submit';
$tag->name = $this->id;
$tag->id = $this->id;
$tag->... | [
"protected",
"function",
"getInputTag",
"(",
")",
"{",
"// We do not use a 'button' element because it is broken differently in",
"// different versions of Internet Explorer",
"$",
"tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'input'",
")",
";",
"$",
"tag",
"->",
"type",
"=",
... | Get the HTML tag to display for this button
Can be used by sub-classes to change the setup of the input tag.
@return SwatHtmlTag the HTML tag to display for this button. | [
"Get",
"the",
"HTML",
"tag",
"to",
"display",
"for",
"this",
"button"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatButton.php#L290-L310 |
33,901 | silverorange/swat | Swat/SwatButton.php | SwatButton.getCSSClassNames | protected function getCSSClassNames()
{
$classes = array('swat-button');
$form = $this->getFirstAncestor('SwatForm');
$primary =
$form !== null && $form->getFirstDescendant('SwatButton') === $this;
if ($primary) {
$classes[] = 'swat-primary';
}
... | php | protected function getCSSClassNames()
{
$classes = array('swat-button');
$form = $this->getFirstAncestor('SwatForm');
$primary =
$form !== null && $form->getFirstDescendant('SwatButton') === $this;
if ($primary) {
$classes[] = 'swat-primary';
}
... | [
"protected",
"function",
"getCSSClassNames",
"(",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
"'swat-button'",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"getFirstAncestor",
"(",
"'SwatForm'",
")",
";",
"$",
"primary",
"=",
"$",
"form",
"!==",
"null... | Gets the array of CSS classes that are applied to this button
@return array the array of CSS classes that are applied to this button. | [
"Gets",
"the",
"array",
"of",
"CSS",
"classes",
"that",
"are",
"applied",
"to",
"this",
"button"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatButton.php#L320-L339 |
33,902 | silverorange/swat | Swat/SwatTileViewGroup.php | SwatTileViewGroup.displayGroupHeader | protected function displayGroupHeader($row)
{
$div_tag = new SwatHtmlTag('div');
$div_tag->class = 'swat-tile-view-group';
if ($this->header_current === null) {
$div_tag->class .= ' swat-tile-view-first-group';
}
$div_tag->open();
$heading_tag = new Swa... | php | protected function displayGroupHeader($row)
{
$div_tag = new SwatHtmlTag('div');
$div_tag->class = 'swat-tile-view-group';
if ($this->header_current === null) {
$div_tag->class .= ' swat-tile-view-first-group';
}
$div_tag->open();
$heading_tag = new Swa... | [
"protected",
"function",
"displayGroupHeader",
"(",
"$",
"row",
")",
"{",
"$",
"div_tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'div'",
")",
";",
"$",
"div_tag",
"->",
"class",
"=",
"'swat-tile-view-group'",
";",
"if",
"(",
"$",
"this",
"->",
"header_current",
... | Displays the group header for this grouping tile
The grouping header is displayed at the beginning of a group.
@param mixed $row a data object containing the data for the first row in
in the table model for this group. | [
"Displays",
"the",
"group",
"header",
"for",
"this",
"grouping",
"tile"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTileViewGroup.php#L93-L110 |
33,903 | silverorange/swat | Swat/SwatTileViewGroup.php | SwatTileViewGroup.displayRenderers | protected function displayRenderers($row)
{
if ($this->group_by === null) {
throw new SwatException("Attribute 'group_by' must be set.");
}
$group_by = $this->group_by;
// only display the group header if the value of the group-by field has
// changed
if... | php | protected function displayRenderers($row)
{
if ($this->group_by === null) {
throw new SwatException("Attribute 'group_by' must be set.");
}
$group_by = $this->group_by;
// only display the group header if the value of the group-by field has
// changed
if... | [
"protected",
"function",
"displayRenderers",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"group_by",
"===",
"null",
")",
"{",
"throw",
"new",
"SwatException",
"(",
"\"Attribute 'group_by' must be set.\"",
")",
";",
"}",
"$",
"group_by",
"=",
"$"... | Displays the renderers for this tile
The renderes are only displayed once for every time the value of the
group_by field changes and the renderers are displayed as a divider
between tiles.
@param mixed $row a data object containing the data for a single row
in the table model for this group.
@throws SwatException | [
"Displays",
"the",
"renderers",
"for",
"this",
"tile"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTileViewGroup.php#L144-L159 |
33,904 | TeknooSoftware/states | src/Proxy/ProxyTrait.php | ProxyTrait.pushCallerStatedClassName | private function pushCallerStatedClassName(StateInterface $state): ProxyInterface
{
$stateClass = \get_class($state);
if (!isset($this->classesByStates[$stateClass])) {
throw new \RuntimeException("Error, no original class name defined for $stateClass");
}
$this->caller... | php | private function pushCallerStatedClassName(StateInterface $state): ProxyInterface
{
$stateClass = \get_class($state);
if (!isset($this->classesByStates[$stateClass])) {
throw new \RuntimeException("Error, no original class name defined for $stateClass");
}
$this->caller... | [
"private",
"function",
"pushCallerStatedClassName",
"(",
"StateInterface",
"$",
"state",
")",
":",
"ProxyInterface",
"{",
"$",
"stateClass",
"=",
"\\",
"get_class",
"(",
"$",
"state",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"classesByState... | To push in the caller stated classes name stack
the class of the current object.
@param StateInterface $state
@return ProxyInterface | [
"To",
"push",
"in",
"the",
"caller",
"stated",
"classes",
"name",
"stack",
"the",
"class",
"of",
"the",
"current",
"object",
"."
] | 0c675b768781ee3a3a15c2663cffec5d50c1d5fd | https://github.com/TeknooSoftware/states/blob/0c675b768781ee3a3a15c2663cffec5d50c1d5fd/src/Proxy/ProxyTrait.php#L223-L234 |
33,905 | TeknooSoftware/states | src/Proxy/ProxyTrait.php | ProxyTrait.popCallerStatedClassName | private function popCallerStatedClassName(): ProxyInterface
{
if (false === $this->callerStatedClassesStack->isEmpty()) {
$this->callerStatedClassesStack->pop();
}
return $this;
} | php | private function popCallerStatedClassName(): ProxyInterface
{
if (false === $this->callerStatedClassesStack->isEmpty()) {
$this->callerStatedClassesStack->pop();
}
return $this;
} | [
"private",
"function",
"popCallerStatedClassName",
"(",
")",
":",
"ProxyInterface",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"callerStatedClassesStack",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"this",
"->",
"callerStatedClassesStack",
"->",
"pop",
... | To pop the current caller in the stated class name stack.
@return ProxyInterface | [
"To",
"pop",
"the",
"current",
"caller",
"in",
"the",
"stated",
"class",
"name",
"stack",
"."
] | 0c675b768781ee3a3a15c2663cffec5d50c1d5fd | https://github.com/TeknooSoftware/states/blob/0c675b768781ee3a3a15c2663cffec5d50c1d5fd/src/Proxy/ProxyTrait.php#L241-L248 |
33,906 | TeknooSoftware/states | src/Proxy/ProxyTrait.php | ProxyTrait.callMethod | private function callMethod(
StateInterface $state,
string &$methodName,
array &$arguments,
string &$scopeVisibility,
callable &$callback
) : ProxyInterface {
$callerStatedClass = $this->getCallerStatedClassName();
$this->pushCallerStatedClassName($state);
... | php | private function callMethod(
StateInterface $state,
string &$methodName,
array &$arguments,
string &$scopeVisibility,
callable &$callback
) : ProxyInterface {
$callerStatedClass = $this->getCallerStatedClassName();
$this->pushCallerStatedClassName($state);
... | [
"private",
"function",
"callMethod",
"(",
"StateInterface",
"$",
"state",
",",
"string",
"&",
"$",
"methodName",
",",
"array",
"&",
"$",
"arguments",
",",
"string",
"&",
"$",
"scopeVisibility",
",",
"callable",
"&",
"$",
"callback",
")",
":",
"ProxyInterface... | Prepare the execution's context and execute a method in a state passed in args with the closure.
@param StateInterface $state
@param string $methodName
@param array $arguments
@param string $scopeVisibility self::VISIBILITY_PUBLIC
self::VISIBILITY_PROTECTED
self::VISIBILITY_PRIVATE
@param call... | [
"Prepare",
"the",
"execution",
"s",
"context",
"and",
"execute",
"a",
"method",
"in",
"a",
"state",
"passed",
"in",
"args",
"with",
"the",
"closure",
"."
] | 0c675b768781ee3a3a15c2663cffec5d50c1d5fd | https://github.com/TeknooSoftware/states/blob/0c675b768781ee3a3a15c2663cffec5d50c1d5fd/src/Proxy/ProxyTrait.php#L265-L289 |
33,907 | TeknooSoftware/states | src/Proxy/ProxyTrait.php | ProxyTrait.initializeProxy | protected function initializeProxy(): void
{
//Initialize internal vars
$this->states = [];
$this->activesStates = [];
$this->callerStatedClassesStack = new \SplStack();
//Creates
$this->loadStates();
} | php | protected function initializeProxy(): void
{
//Initialize internal vars
$this->states = [];
$this->activesStates = [];
$this->callerStatedClassesStack = new \SplStack();
//Creates
$this->loadStates();
} | [
"protected",
"function",
"initializeProxy",
"(",
")",
":",
"void",
"{",
"//Initialize internal vars",
"$",
"this",
"->",
"states",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"activesStates",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"callerStatedClassesStack",
"=",... | Method to call into the constructor to initialize proxy's vars.
Externalized from the constructor to allow developers to write their own constructors into theirs classes.
@throws Exception\StateNotFound | [
"Method",
"to",
"call",
"into",
"the",
"constructor",
"to",
"initialize",
"proxy",
"s",
"vars",
".",
"Externalized",
"from",
"the",
"constructor",
"to",
"allow",
"developers",
"to",
"write",
"their",
"own",
"constructors",
"into",
"theirs",
"classes",
"."
] | 0c675b768781ee3a3a15c2663cffec5d50c1d5fd | https://github.com/TeknooSoftware/states/blob/0c675b768781ee3a3a15c2663cffec5d50c1d5fd/src/Proxy/ProxyTrait.php#L372-L380 |
33,908 | TeknooSoftware/states | src/Proxy/ProxyTrait.php | ProxyTrait.extractVisibilityScopeFromObject | private function extractVisibilityScopeFromObject(&$callerObject): string
{
if ($this === $callerObject) {
//It's me ! Mario ! So Private scope
return StateInterface::VISIBILITY_PRIVATE;
}
if (\get_class($this) === \get_class($callerObject)) {
//It's a br... | php | private function extractVisibilityScopeFromObject(&$callerObject): string
{
if ($this === $callerObject) {
//It's me ! Mario ! So Private scope
return StateInterface::VISIBILITY_PRIVATE;
}
if (\get_class($this) === \get_class($callerObject)) {
//It's a br... | [
"private",
"function",
"extractVisibilityScopeFromObject",
"(",
"&",
"$",
"callerObject",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"===",
"$",
"callerObject",
")",
"{",
"//It's me ! Mario ! So Private scope",
"return",
"StateInterface",
"::",
"VISIBILITY_PRIVA... | To compute the visibility scope from the object instance of the caller.
Called from another class (not a child class), via a static method or an instance of this class : Public scope
Called from a child class, via a static method or an instance of this class : Protected scope
Called from a static method of this stated... | [
"To",
"compute",
"the",
"visibility",
"scope",
"from",
"the",
"object",
"instance",
"of",
"the",
"caller",
"."
] | 0c675b768781ee3a3a15c2663cffec5d50c1d5fd | https://github.com/TeknooSoftware/states/blob/0c675b768781ee3a3a15c2663cffec5d50c1d5fd/src/Proxy/ProxyTrait.php#L395-L414 |
33,909 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.createEntry | public function createEntry(
$title,
$link = null,
$content_type = 'text/plain'
) {
$this->addEntry(new SwatNavBarEntry($title, $link, $content_type));
} | php | public function createEntry(
$title,
$link = null,
$content_type = 'text/plain'
) {
$this->addEntry(new SwatNavBarEntry($title, $link, $content_type));
} | [
"public",
"function",
"createEntry",
"(",
"$",
"title",
",",
"$",
"link",
"=",
"null",
",",
"$",
"content_type",
"=",
"'text/plain'",
")",
"{",
"$",
"this",
"->",
"addEntry",
"(",
"new",
"SwatNavBarEntry",
"(",
"$",
"title",
",",
"$",
"link",
",",
"$",... | Creates a SwatNavBarEntry and adds it to the end of this navigation bar
@param string $title the entry title.
@param string $link an optional entry URI.
@param string $content_type an optional content type for the entry title. | [
"Creates",
"a",
"SwatNavBarEntry",
"and",
"adds",
"it",
"to",
"the",
"end",
"of",
"this",
"navigation",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L66-L72 |
33,910 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.replaceEntryByPosition | public function replaceEntryByPosition(
$position,
SwatNavBarEntry $new_entry
) {
if (isset($this->entries[$position])) {
$old_entry = $this->entries[$position];
$this->entries[$position] = $new_entry;
return $old_entry;
}
throw new SwatE... | php | public function replaceEntryByPosition(
$position,
SwatNavBarEntry $new_entry
) {
if (isset($this->entries[$position])) {
$old_entry = $this->entries[$position];
$this->entries[$position] = $new_entry;
return $old_entry;
}
throw new SwatE... | [
"public",
"function",
"replaceEntryByPosition",
"(",
"$",
"position",
",",
"SwatNavBarEntry",
"$",
"new_entry",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entries",
"[",
"$",
"position",
"]",
")",
")",
"{",
"$",
"old_entry",
"=",
"$",
"this",... | Replaces an entry in this navigation bar
If the entry is not in this navigation bar, an exception is thrown.
@param integer $position zero-based ordinal position of the entry
to replace.
@param SwatNavBarEntry $entry the navbar entry to replace the element
at the given position with.
@return SwatNavBarEntry the repl... | [
"Replaces",
"an",
"entry",
"in",
"this",
"navigation",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L133-L152 |
33,911 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.getEntryByPosition | public function getEntryByPosition($position)
{
if ($position < 0) {
$position = count($this) + $position - 1;
}
if (isset($this->entries[$position])) {
return $this->entries[$position];
} else {
throw new SwatException(
sprintf(
... | php | public function getEntryByPosition($position)
{
if ($position < 0) {
$position = count($this) + $position - 1;
}
if (isset($this->entries[$position])) {
return $this->entries[$position];
} else {
throw new SwatException(
sprintf(
... | [
"public",
"function",
"getEntryByPosition",
"(",
"$",
"position",
")",
"{",
"if",
"(",
"$",
"position",
"<",
"0",
")",
"{",
"$",
"position",
"=",
"count",
"(",
"$",
"this",
")",
"+",
"$",
"position",
"-",
"1",
";",
"}",
"if",
"(",
"isset",
"(",
"... | Gets an entry from this navigation bar
If the entry is not in this navigation bar, an exception is thrown.
@param integer $position zero-based ordinal position of the entry to
fetch. If position is negative, the entry
position is counted from the end of the nav
bar (-1 will return one from the end). Use
getLastEntr... | [
"Gets",
"an",
"entry",
"from",
"this",
"navigation",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L173-L189 |
33,912 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.popEntries | public function popEntries($number)
{
if (count($this) < $number) {
$count = count($this);
throw new SwatException(
printf(
'Unable to pop %s entries. NavBar ' .
'only contains %s entries.',
$number,
... | php | public function popEntries($number)
{
if (count($this) < $number) {
$count = count($this);
throw new SwatException(
printf(
'Unable to pop %s entries. NavBar ' .
'only contains %s entries.',
$number,
... | [
"public",
"function",
"popEntries",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
")",
"<",
"$",
"number",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"this",
")",
";",
"throw",
"new",
"SwatException",
"(",
"printf",
"(",
... | Pops one or more entries off the end of this navigational bar
If more entries are to be popped than currently exist, an exception is
thrown.
@param $number integer number of entries to pop off this navigational
bar.
@return array an array of SwatNavBarEntry objects that were popped off
the navagational bar.
@throws... | [
"Pops",
"one",
"or",
"more",
"entries",
"off",
"the",
"end",
"of",
"this",
"navigational",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L283-L299 |
33,913 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.display | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$count = count($this);
$i = 1;
$container_tag = $this->getContainerTag();
$container_tag->open();
foreach ($this->entries as $entry) {
// displa... | php | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$count = count($this);
$i = 1;
$container_tag = $this->getContainerTag();
$container_tag->open();
foreach ($this->entries as $entry) {
// displa... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"display",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"this",
")",
";",
"$",
"i",
"=",
"1",
... | Displays this navigational bar
Displays each entry separated by a special character and outputs
navbar entries with links as anchor tags. | [
"Displays",
"this",
"navigational",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L326-L355 |
33,914 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.displayEntry | protected function displayEntry(
SwatNavBarEntry $entry,
$show_link = true,
$first = false
) {
$title = $entry->title === null ? '' : $entry->title;
$link = $this->getLink($entry);
if ($link !== null && $show_link) {
$a_tag = new SwatHtmlTag('a');
... | php | protected function displayEntry(
SwatNavBarEntry $entry,
$show_link = true,
$first = false
) {
$title = $entry->title === null ? '' : $entry->title;
$link = $this->getLink($entry);
if ($link !== null && $show_link) {
$a_tag = new SwatHtmlTag('a');
... | [
"protected",
"function",
"displayEntry",
"(",
"SwatNavBarEntry",
"$",
"entry",
",",
"$",
"show_link",
"=",
"true",
",",
"$",
"first",
"=",
"false",
")",
"{",
"$",
"title",
"=",
"$",
"entry",
"->",
"title",
"===",
"null",
"?",
"''",
":",
"$",
"entry",
... | Displays an entry in this navigational bar
@param SwatNavBarEntry $entry the entry to display.
@param boolean $link whether or not to hyperlink the given entry if the
entry has a link set.
@param boolean $first whether or not this entry should be displayed as
the first entry. | [
"Displays",
"an",
"entry",
"in",
"this",
"navigational",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L369-L395 |
33,915 | silverorange/swat | Swat/SwatNavBar.php | SwatNavBar.getContainerTag | protected function getContainerTag()
{
if ($this->container_tag === null) {
$tag = new SwatHtmlTag('div');
} else {
$tag = $this->container_tag;
}
$tag->id = $this->id;
$tag->class = $this->getCSSClassString();
return $tag;
} | php | protected function getContainerTag()
{
if ($this->container_tag === null) {
$tag = new SwatHtmlTag('div');
} else {
$tag = $this->container_tag;
}
$tag->id = $this->id;
$tag->class = $this->getCSSClassString();
return $tag;
} | [
"protected",
"function",
"getContainerTag",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"container_tag",
"===",
"null",
")",
"{",
"$",
"tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'div'",
")",
";",
"}",
"else",
"{",
"$",
"tag",
"=",
"$",
"this",
"->",
... | Gets the container tag for this navigational bar
The container tag wraps around all entries in this navigational bar.
@return SwatHtmlTag the container tag for this navigational bar. | [
"Gets",
"the",
"container",
"tag",
"for",
"this",
"navigational",
"bar"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatNavBar.php#L438-L449 |
33,916 | silverorange/swat | Swat/SwatTreeFlydown.php | SwatTreeFlydown.display | public function display()
{
if (!$this->visible) {
return;
}
$actual_value = $this->value;
if (count($this->path) === 0 && $this->value !== null) {
// If there is a value but not a path, assume the value is the
// first element in the path.
... | php | public function display()
{
if (!$this->visible) {
return;
}
$actual_value = $this->value;
if (count($this->path) === 0 && $this->value !== null) {
// If there is a value but not a path, assume the value is the
// first element in the path.
... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"$",
"actual_value",
"=",
"$",
"this",
"->",
"value",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"path",
")",
"===",... | Displays this tree flydown | [
"Displays",
"this",
"tree",
"flydown"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTreeFlydown.php#L62-L82 |
33,917 | silverorange/swat | Swat/SwatTreeFlydown.php | SwatTreeFlydown.flattenTree | private function flattenTree(
&$options,
SwatTreeFlydownNode $node,
$level = 0,
$path = array()
) {
$tree_option = clone $node->getOption();
$pad = str_repeat(' ', $level * 3);
$path[] = $tree_option->value;
$tree_option->title = $pad . $tree_op... | php | private function flattenTree(
&$options,
SwatTreeFlydownNode $node,
$level = 0,
$path = array()
) {
$tree_option = clone $node->getOption();
$pad = str_repeat(' ', $level * 3);
$path[] = $tree_option->value;
$tree_option->title = $pad . $tree_op... | [
"private",
"function",
"flattenTree",
"(",
"&",
"$",
"options",
",",
"SwatTreeFlydownNode",
"$",
"node",
",",
"$",
"level",
"=",
"0",
",",
"$",
"path",
"=",
"array",
"(",
")",
")",
"{",
"$",
"tree_option",
"=",
"clone",
"$",
"node",
"->",
"getOption",
... | Flattens this flydown's tree into an array of flydown options
The tree is represented by placing spaces in front of option titles for
different levels. The values of the options are set to an array
representing the tree nodes's paths in the tree.
@param array $options a reference to an array to add the flattened tree... | [
"Flattens",
"this",
"flydown",
"s",
"tree",
"into",
"an",
"array",
"of",
"flydown",
"options"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTreeFlydown.php#L122-L141 |
33,918 | silverorange/swat | Swat/SwatTreeFlydown.php | SwatTreeFlydown.setTree | public function setTree($tree)
{
if ($tree instanceof SwatDataTreeNode) {
$tree = SwatTreeFlydownNode::convertFromDataTree($tree);
} elseif (!($tree instanceof SwatTreeFlydownNode)) {
throw new SwatInvalidClassException(
'Tree must be an intance of ' .
... | php | public function setTree($tree)
{
if ($tree instanceof SwatDataTreeNode) {
$tree = SwatTreeFlydownNode::convertFromDataTree($tree);
} elseif (!($tree instanceof SwatTreeFlydownNode)) {
throw new SwatInvalidClassException(
'Tree must be an intance of ' .
... | [
"public",
"function",
"setTree",
"(",
"$",
"tree",
")",
"{",
"if",
"(",
"$",
"tree",
"instanceof",
"SwatDataTreeNode",
")",
"{",
"$",
"tree",
"=",
"SwatTreeFlydownNode",
"::",
"convertFromDataTree",
"(",
"$",
"tree",
")",
";",
"}",
"elseif",
"(",
"!",
"(... | Sets the tree to use for display
@param SwatTreeFlydownNode|SwatDataTreeNode $tree the tree to use for
display. | [
"Sets",
"the",
"tree",
"to",
"use",
"for",
"display"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTreeFlydown.php#L152-L166 |
33,919 | silverorange/swat | Swat/SwatTreeFlydown.php | SwatTreeFlydown.process | public function process()
{
parent::process();
if ($this->value === null) {
$this->path = array();
} else {
$this->path = $this->value;
$this->value = end($this->path);
}
} | php | public function process()
{
parent::process();
if ($this->value === null) {
$this->path = array();
} else {
$this->path = $this->value;
$this->value = end($this->path);
}
} | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"array",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->... | Processes this tree flydown
Populates the path property of this flydown with the path to the node
selected by the user. The widget value is set to the last id in the
path array. | [
"Processes",
"this",
"tree",
"flydown"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatTreeFlydown.php#L192-L202 |
33,920 | brainworxx/kreXX | src/Analyse/Routing/Process/ProcessClosure.php | ProcessClosure.process | public function process(Model $model)
{
$ref = new \ReflectionFunction($model->getData());
$result = array();
// Adding comments from the file.
$result[static::META_COMMENT] = $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Comment\\Functions')
->get... | php | public function process(Model $model)
{
$ref = new \ReflectionFunction($model->getData());
$result = array();
// Adding comments from the file.
$result[static::META_COMMENT] = $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Comment\\Functions')
->get... | [
"public",
"function",
"process",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionFunction",
"(",
"$",
"model",
"->",
"getData",
"(",
")",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// Adding comments from the fi... | Analyses a closure.
@param Model $model
The closure we want to analyse.
@throws \ReflectionException
@return string
The generated markup. | [
"Analyses",
"a",
"closure",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Routing/Process/ProcessClosure.php#L59-L114 |
33,921 | rhoone/yii2-rhoone | base/DictionaryManager.php | DictionaryManager.getHeadwords | public function getHeadwords($class = null, $words = [])
{
// Method One:
if ($class === null || $class === false || (is_string($class) && empty($class))) {
$query = Headword::find();
} else {
$extensions = ExtensionManager::getModels($class);
$guids = [];... | php | public function getHeadwords($class = null, $words = [])
{
// Method One:
if ($class === null || $class === false || (is_string($class) && empty($class))) {
$query = Headword::find();
} else {
$extensions = ExtensionManager::getModels($class);
$guids = [];... | [
"public",
"function",
"getHeadwords",
"(",
"$",
"class",
"=",
"null",
",",
"$",
"words",
"=",
"[",
"]",
")",
"{",
"// Method One:",
"if",
"(",
"$",
"class",
"===",
"null",
"||",
"$",
"class",
"===",
"false",
"||",
"(",
"is_string",
"(",
"$",
"class",... | Headwords generator.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension|mixed $class
`string` if extension class.
@param string[] $words
@throws InvalidParamException | [
"Headwords",
"generator",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/base/DictionaryManager.php#L39-L60 |
33,922 | rhoone/yii2-rhoone | base/DictionaryManager.php | DictionaryManager.getSynonyms | public function getSynonyms($class = null, $words = [])
{
// Method One:
$query = Synonym::find();
if (is_array($words) && !empty($words)) {
$query = $query->word($words);
}
if (!($class === null || $class === false || (is_string($class) && empty($class)))) {
... | php | public function getSynonyms($class = null, $words = [])
{
// Method One:
$query = Synonym::find();
if (is_array($words) && !empty($words)) {
$query = $query->word($words);
}
if (!($class === null || $class === false || (is_string($class) && empty($class)))) {
... | [
"public",
"function",
"getSynonyms",
"(",
"$",
"class",
"=",
"null",
",",
"$",
"words",
"=",
"[",
"]",
")",
"{",
"// Method One:",
"$",
"query",
"=",
"Synonym",
"::",
"find",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"words",
")",
"&&",
"!",
... | Synonyms generator.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension|mixed $class
`string` if extension class.
@param string[] $words
@throws InvalidParamException | [
"Synonyms",
"generator",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/base/DictionaryManager.php#L69-L84 |
33,923 | brainworxx/kreXX | src/Analyse/Caller/CallerFinder.php | CallerFinder.getVarName | protected function getVarName($file, $line)
{
// Set a fallback value.
$varname = static::UNKNOWN_VALUE;
// Retrieve the call from the sourcecode file.
if ($this->pool->fileService->fileIsReadable($file) === false) {
return $varname;
}
$line--;
... | php | protected function getVarName($file, $line)
{
// Set a fallback value.
$varname = static::UNKNOWN_VALUE;
// Retrieve the call from the sourcecode file.
if ($this->pool->fileService->fileIsReadable($file) === false) {
return $varname;
}
$line--;
... | [
"protected",
"function",
"getVarName",
"(",
"$",
"file",
",",
"$",
"line",
")",
"{",
"// Set a fallback value.",
"$",
"varname",
"=",
"static",
"::",
"UNKNOWN_VALUE",
";",
"// Retrieve the call from the sourcecode file.",
"if",
"(",
"$",
"this",
"->",
"pool",
"->"... | Tries to extract the name of the variable which we try to analyse.
@param string $file
Path to the sourcecode file.
@param int $line
The line from where kreXX was called.
@return string
The name of the variable. | [
"Tries",
"to",
"extract",
"the",
"name",
"of",
"the",
"variable",
"which",
"we",
"try",
"to",
"analyse",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Caller/CallerFinder.php#L126-L165 |
33,924 | silverorange/swat | Swat/SwatHtmlHeadEntry.php | SwatHtmlHeadEntry.display | public function display($uri_prefix = '', $tag = null)
{
$this->openIECondition();
$this->displayInternal($uri_prefix, $tag);
$this->closeIECondition();
} | php | public function display($uri_prefix = '', $tag = null)
{
$this->openIECondition();
$this->displayInternal($uri_prefix, $tag);
$this->closeIECondition();
} | [
"public",
"function",
"display",
"(",
"$",
"uri_prefix",
"=",
"''",
",",
"$",
"tag",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"openIECondition",
"(",
")",
";",
"$",
"this",
"->",
"displayInternal",
"(",
"$",
"uri_prefix",
",",
"$",
"tag",
")",
";",
... | Displays this html head entry
Entries are displayed differently based on type.
@param string $uri_prefix an optional string to prefix the URI with.
@param string $tag an optional tag to suffix the URI with. This is
suffixed as a HTTP get var and can be used to
explicitly refresh the browser cache. | [
"Displays",
"this",
"html",
"head",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatHtmlHeadEntry.php#L64-L69 |
33,925 | gdbots/schemas | build/php/src/Gdbots/Schemas/Ncr/NodeRef.php | NodeRef.fromFilePath | public static function fromFilePath(string $string): self
{
$parts = explode('/', $string, 5);
unset($parts[2]);
unset($parts[3]);
return self::fromString(
str_replace(['__FS__', '__CLN__'], ['/', ':'], implode(':', $parts))
);
} | php | public static function fromFilePath(string $string): self
{
$parts = explode('/', $string, 5);
unset($parts[2]);
unset($parts[3]);
return self::fromString(
str_replace(['__FS__', '__CLN__'], ['/', ':'], implode(':', $parts))
);
} | [
"public",
"static",
"function",
"fromFilePath",
"(",
"string",
"$",
"string",
")",
":",
"self",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"string",
",",
"5",
")",
";",
"unset",
"(",
"$",
"parts",
"[",
"2",
"]",
")",
";",
"unset",
"... | Creates a NodeRef from a file path, assuming it was generated by the "toFilePath" method.
@param string $string
@return static | [
"Creates",
"a",
"NodeRef",
"from",
"a",
"file",
"path",
"assuming",
"it",
"was",
"generated",
"by",
"the",
"toFilePath",
"method",
"."
] | daa2d8257b151c6cf48b3fc60ff50155a037045a | https://github.com/gdbots/schemas/blob/daa2d8257b151c6cf48b3fc60ff50155a037045a/build/php/src/Gdbots/Schemas/Ncr/NodeRef.php#L160-L169 |
33,926 | brainworxx/kreXX | src/Service/Plugin/Registration.php | Registration.registerAdditionalskin | public static function registerAdditionalskin($name, $className, $directory)
{
static::$additionalSkinList[$name] = array(
static::SKIN_CLASS => $className,
static::SKIN_DIRECTORY => $directory
);
} | php | public static function registerAdditionalskin($name, $className, $directory)
{
static::$additionalSkinList[$name] = array(
static::SKIN_CLASS => $className,
static::SKIN_DIRECTORY => $directory
);
} | [
"public",
"static",
"function",
"registerAdditionalskin",
"(",
"$",
"name",
",",
"$",
"className",
",",
"$",
"directory",
")",
"{",
"static",
"::",
"$",
"additionalSkinList",
"[",
"$",
"name",
"]",
"=",
"array",
"(",
"static",
"::",
"SKIN_CLASS",
"=>",
"$"... | Register an additional skin. You can also overwrite already existing
skins, if you use their name.
@param string $name
The name of the skin. 'hans' and 'smokygrey' are the bundeled ones.
@param string $className
The full qualified class name of the renderer
@param string $directory
The absolute path to the skin html f... | [
"Register",
"an",
"additional",
"skin",
".",
"You",
"can",
"also",
"overwrite",
"already",
"existing",
"skins",
"if",
"you",
"use",
"their",
"name",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Service/Plugin/Registration.php#L256-L262 |
33,927 | brainworxx/kreXX | src/Service/Plugin/Registration.php | Registration.activatePlugin | public static function activatePlugin($configClass)
{
if (isset(static::$plugins[$configClass])) {
static::$plugins[$configClass][static::IS_ACTIVE] = true;
/** @var \Brainworxx\Krexx\Service\Plugin\PluginConfigInterface $staticPlugin */
$staticPlugin = static::$plugins[$... | php | public static function activatePlugin($configClass)
{
if (isset(static::$plugins[$configClass])) {
static::$plugins[$configClass][static::IS_ACTIVE] = true;
/** @var \Brainworxx\Krexx\Service\Plugin\PluginConfigInterface $staticPlugin */
$staticPlugin = static::$plugins[$... | [
"public",
"static",
"function",
"activatePlugin",
"(",
"$",
"configClass",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"plugins",
"[",
"$",
"configClass",
"]",
")",
")",
"{",
"static",
"::",
"$",
"plugins",
"[",
"$",
"configClass",
"]",
"["... | We activate the plugin with the name, and execute its configuration method.
@param string $configClass
The class name of the configuration class for this plugin. | [
"We",
"activate",
"the",
"plugin",
"with",
"the",
"name",
"and",
"execute",
"its",
"configuration",
"method",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Service/Plugin/Registration.php#L287-L304 |
33,928 | brainworxx/kreXX | src/Service/Plugin/Registration.php | Registration.deactivatePlugin | public static function deactivatePlugin($configClass)
{
if (static::$plugins[$configClass][static::IS_ACTIVE] !== true) {
// We will not purge everything for a already deactivated plugin.
return;
}
// Purge all settings in the underlying registration class.
s... | php | public static function deactivatePlugin($configClass)
{
if (static::$plugins[$configClass][static::IS_ACTIVE] !== true) {
// We will not purge everything for a already deactivated plugin.
return;
}
// Purge all settings in the underlying registration class.
s... | [
"public",
"static",
"function",
"deactivatePlugin",
"(",
"$",
"configClass",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"plugins",
"[",
"$",
"configClass",
"]",
"[",
"static",
"::",
"IS_ACTIVE",
"]",
"!==",
"true",
")",
"{",
"// We will not purge everything for... | We deactivate the plugin and reset the configuration
@param string $configClass
The name of the plugin. | [
"We",
"deactivate",
"the",
"plugin",
"and",
"reset",
"the",
"configuration"
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Service/Plugin/Registration.php#L312-L346 |
33,929 | silverorange/swat | Swat/SwatCascadeFlydown.php | SwatCascadeFlydown.addOptionsByArray | public function addOptionsByArray(
array $options,
$content_type = 'text/plain'
) {
foreach ($options as $parent => $child_options) {
foreach ($child_options as $value => $title) {
$this->addOption($parent, $value, $title, $content_type);
}
}
... | php | public function addOptionsByArray(
array $options,
$content_type = 'text/plain'
) {
foreach ($options as $parent => $child_options) {
foreach ($child_options as $value => $title) {
$this->addOption($parent, $value, $title, $content_type);
}
}
... | [
"public",
"function",
"addOptionsByArray",
"(",
"array",
"$",
"options",
",",
"$",
"content_type",
"=",
"'text/plain'",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"parent",
"=>",
"$",
"child_options",
")",
"{",
"foreach",
"(",
"$",
"child_options",... | Adds options to this option control using an associative array
@param array $options an array of options. Keys are option parent values.
Values are a 2-element associative array of
title => value pairs.
@param string $content_type optional. The content type of the option
titles. If not specified, defaults to
'text/pla... | [
"Adds",
"options",
"to",
"this",
"option",
"control",
"using",
"an",
"associative",
"array"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCascadeFlydown.php#L133-L142 |
33,930 | silverorange/swat | Swat/SwatCascadeFlydown.php | SwatCascadeFlydown.& | protected function &getOptions()
{
$options = array();
// If the parent flydown is empty, set parent_value to a blank string.
// This will then return any options that exist for a blank parent.
$parent_value = $this->hasEmptyParent() ? '' : $this->getParentValue();
// paren... | php | protected function &getOptions()
{
$options = array();
// If the parent flydown is empty, set parent_value to a blank string.
// This will then return any options that exist for a blank parent.
$parent_value = $this->hasEmptyParent() ? '' : $this->getParentValue();
// paren... | [
"protected",
"function",
"&",
"getOptions",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"// If the parent flydown is empty, set parent_value to a blank string.",
"// This will then return any options that exist for a blank parent.",
"$",
"parent_value",
"=",
"$"... | Gets the options of this flydown as a flat array
For the cascading flydown, the array returned
The array is of the form:
value => title
@return array the options of this flydown as a flat array.
@see SwatFlydown::getOptions() | [
"Gets",
"the",
"options",
"of",
"this",
"flydown",
"as",
"a",
"flat",
"array"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCascadeFlydown.php#L159-L191 |
33,931 | silverorange/swat | Swat/SwatCascadeFlydown.php | SwatCascadeFlydown.getInlineJavaScript | protected function getInlineJavaScript()
{
// Javascript is unnecessary when the parent flydown is empty, or when
// it has a single value as in both cases the parent value never
// changes.
if ($this->hasEmptyParent() || $this->hasSingleParent()) {
return;
}
... | php | protected function getInlineJavaScript()
{
// Javascript is unnecessary when the parent flydown is empty, or when
// it has a single value as in both cases the parent value never
// changes.
if ($this->hasEmptyParent() || $this->hasSingleParent()) {
return;
}
... | [
"protected",
"function",
"getInlineJavaScript",
"(",
")",
"{",
"// Javascript is unnecessary when the parent flydown is empty, or when",
"// it has a single value as in both cases the parent value never",
"// changes.",
"if",
"(",
"$",
"this",
"->",
"hasEmptyParent",
"(",
")",
"||"... | Gets the inline JavaScript that makes this control work
@return string the inline JavaScript that makes this control work. | [
"Gets",
"the",
"inline",
"JavaScript",
"that",
"makes",
"this",
"control",
"work"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCascadeFlydown.php#L251-L329 |
33,932 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.addRenderer | public function addRenderer(SwatCellRenderer $renderer)
{
$this->renderers[] = $renderer;
$renderer_key = spl_object_hash($renderer);
$this->mappings[$renderer_key] = array();
if ($renderer->id !== null) {
$this->renderers_by_id[$renderer->id] = $renderer;
}
... | php | public function addRenderer(SwatCellRenderer $renderer)
{
$this->renderers[] = $renderer;
$renderer_key = spl_object_hash($renderer);
$this->mappings[$renderer_key] = array();
if ($renderer->id !== null) {
$this->renderers_by_id[$renderer->id] = $renderer;
}
... | [
"public",
"function",
"addRenderer",
"(",
"SwatCellRenderer",
"$",
"renderer",
")",
"{",
"$",
"this",
"->",
"renderers",
"[",
"]",
"=",
"$",
"renderer",
";",
"$",
"renderer_key",
"=",
"spl_object_hash",
"(",
"$",
"renderer",
")",
";",
"$",
"this",
"->",
... | Adds a cell renderer to this set
An empty datafield-property mapping array is created for the added
renderer.
@param SwatCellRenderer $renderer the renderer to add. | [
"Adds",
"a",
"cell",
"renderer",
"to",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L64-L74 |
33,933 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.addRendererWithMappings | public function addRendererWithMappings(
SwatCellRenderer $renderer,
array $mappings = array()
) {
$this->addRenderer($renderer);
$this->addMappingsToRenderer($renderer, $mappings);
} | php | public function addRendererWithMappings(
SwatCellRenderer $renderer,
array $mappings = array()
) {
$this->addRenderer($renderer);
$this->addMappingsToRenderer($renderer, $mappings);
} | [
"public",
"function",
"addRendererWithMappings",
"(",
"SwatCellRenderer",
"$",
"renderer",
",",
"array",
"$",
"mappings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"addRenderer",
"(",
"$",
"renderer",
")",
";",
"$",
"this",
"->",
"addMappingsToRen... | Adds a cell renderer to this set with a predefined set of
datafield-property mappings
@param SwatCellRenderer $renderer the renderer to add.
@param array $mappings an array of SwatCellRendererMapping objects.
@see SwatCellRendererSet::addRenderer()
@see SwatCellRendererSet::addMappingsToRenderer() | [
"Adds",
"a",
"cell",
"renderer",
"to",
"this",
"set",
"with",
"a",
"predefined",
"set",
"of",
"datafield",
"-",
"property",
"mappings"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L89-L95 |
33,934 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.addMappingsToRenderer | public function addMappingsToRenderer(
SwatCellRenderer $renderer,
array $mappings = array()
) {
$renderer_key = spl_object_hash($renderer);
foreach ($mappings as $mapping) {
if ($renderer->isPropertyStatic($mapping->property)) {
throw new SwatException(
... | php | public function addMappingsToRenderer(
SwatCellRenderer $renderer,
array $mappings = array()
) {
$renderer_key = spl_object_hash($renderer);
foreach ($mappings as $mapping) {
if ($renderer->isPropertyStatic($mapping->property)) {
throw new SwatException(
... | [
"public",
"function",
"addMappingsToRenderer",
"(",
"SwatCellRenderer",
"$",
"renderer",
",",
"array",
"$",
"mappings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"renderer_key",
"=",
"spl_object_hash",
"(",
"$",
"renderer",
")",
";",
"foreach",
"(",
"$",
"mappi... | Adds a set of datafield-property mappings to a cell renderer already in
this set
@param SwatCellRenderer $renderer the cell renderer to add the mappings
to.
@param array $mappings an array of SwatCellRendererMapping objects.
@throws SwatException if an attepmt to map a static cell renderer
property is made. | [
"Adds",
"a",
"set",
"of",
"datafield",
"-",
"property",
"mappings",
"to",
"a",
"cell",
"renderer",
"already",
"in",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L111-L129 |
33,935 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.addMappingToRenderer | public function addMappingToRenderer(
SwatCellRenderer $renderer,
SwatCellRendererMapping $mapping
) {
if ($renderer->isPropertyStatic($mapping->property)) {
throw new SwatException(
sprintf(
'The %s property can not be data-mapped',
... | php | public function addMappingToRenderer(
SwatCellRenderer $renderer,
SwatCellRendererMapping $mapping
) {
if ($renderer->isPropertyStatic($mapping->property)) {
throw new SwatException(
sprintf(
'The %s property can not be data-mapped',
... | [
"public",
"function",
"addMappingToRenderer",
"(",
"SwatCellRenderer",
"$",
"renderer",
",",
"SwatCellRendererMapping",
"$",
"mapping",
")",
"{",
"if",
"(",
"$",
"renderer",
"->",
"isPropertyStatic",
"(",
"$",
"mapping",
"->",
"property",
")",
")",
"{",
"throw",... | Adds a single property-datafield mapping to a cell renderer already in
this set
@param SwatCellRenderer $renderer the cell renderer to add the mapping
to.
@param SwatCellRendererMapping $mapping the mapping to add.
@throws SwatException if an attepmt to map a static cell renderer
property is made. | [
"Adds",
"a",
"single",
"property",
"-",
"datafield",
"mapping",
"to",
"a",
"cell",
"renderer",
"already",
"in",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L145-L160 |
33,936 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.applyMappingsToRenderer | public function applyMappingsToRenderer(
SwatCellRenderer $renderer,
$data_object
) {
// array to track array properties that we've already seen
$array_properties = array();
$renderer_hash = spl_object_hash($renderer);
foreach ($this->mappings[$renderer_hash] as $map... | php | public function applyMappingsToRenderer(
SwatCellRenderer $renderer,
$data_object
) {
// array to track array properties that we've already seen
$array_properties = array();
$renderer_hash = spl_object_hash($renderer);
foreach ($this->mappings[$renderer_hash] as $map... | [
"public",
"function",
"applyMappingsToRenderer",
"(",
"SwatCellRenderer",
"$",
"renderer",
",",
"$",
"data_object",
")",
"{",
"// array to track array properties that we've already seen",
"$",
"array_properties",
"=",
"array",
"(",
")",
";",
"$",
"renderer_hash",
"=",
"... | Applies the property-datafield mappings to a cell renderer already in
this set using a specified data object
@param SwatCellRenderer $renderer the cell renderer to apply the
mappings to.
@param mixed $data_object an object containg datafields to be
mapped onto the cell renderer. | [
"Applies",
"the",
"property",
"-",
"datafield",
"mappings",
"to",
"a",
"cell",
"renderer",
"already",
"in",
"this",
"set",
"using",
"a",
"specified",
"data",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L174-L221 |
33,937 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.getRendererByPosition | public function getRendererByPosition($position = 0)
{
if ($position < count($this->renderers)) {
return $this->renderers[$position];
}
throw new SwatObjectNotFoundException(
'Set does not contain that many renderers.',
0,
$position
);... | php | public function getRendererByPosition($position = 0)
{
if ($position < count($this->renderers)) {
return $this->renderers[$position];
}
throw new SwatObjectNotFoundException(
'Set does not contain that many renderers.',
0,
$position
);... | [
"public",
"function",
"getRendererByPosition",
"(",
"$",
"position",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"position",
"<",
"count",
"(",
"$",
"this",
"->",
"renderers",
")",
")",
"{",
"return",
"$",
"this",
"->",
"renderers",
"[",
"$",
"position",
"]",
... | Gets a cell renderer in this set by its ordinal position
@param integer $position the ordinal position of the renderer.
@return SwatCellRenderer the cell renderer at the specified position.
@throws SwatObjectNotFoundException if the requested <i>$position</i> is
greater than the number of cell
renderers in this set. | [
"Gets",
"a",
"cell",
"renderer",
"in",
"this",
"set",
"by",
"its",
"ordinal",
"position"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L237-L248 |
33,938 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.getRenderer | public function getRenderer($renderer_id)
{
if (array_key_exists($renderer_id, $this->renderers_by_id)) {
return $this->renderers_by_id[$renderer_id];
}
throw new SwatObjectNotFoundException(
"Cell renderer with an id of '{$renderer_id}' not found.",
0,
... | php | public function getRenderer($renderer_id)
{
if (array_key_exists($renderer_id, $this->renderers_by_id)) {
return $this->renderers_by_id[$renderer_id];
}
throw new SwatObjectNotFoundException(
"Cell renderer with an id of '{$renderer_id}' not found.",
0,
... | [
"public",
"function",
"getRenderer",
"(",
"$",
"renderer_id",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"renderer_id",
",",
"$",
"this",
"->",
"renderers_by_id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"renderers_by_id",
"[",
"$",
"renderer_id",... | Gets a renderer in this set by its id
@param string $renderer_id the id of the renderer to get.
@return SwatCellRenderer the cell renderer from this set with the given
id.
@throws SwatObjectNotFoundException if a renderer with the given
<i>$renderer_id</i> does not exist
in this set. | [
"Gets",
"a",
"renderer",
"in",
"this",
"set",
"by",
"its",
"id"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L265-L276 |
33,939 | silverorange/swat | Swat/SwatCellRendererSet.php | SwatCellRendererSet.getFirst | public function getFirst()
{
$first = null;
if (count($this->renderers) > 0) {
$first = reset($this->renderers);
}
return $first;
} | php | public function getFirst()
{
$first = null;
if (count($this->renderers) > 0) {
$first = reset($this->renderers);
}
return $first;
} | [
"public",
"function",
"getFirst",
"(",
")",
"{",
"$",
"first",
"=",
"null",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"renderers",
")",
">",
"0",
")",
"{",
"$",
"first",
"=",
"reset",
"(",
"$",
"this",
"->",
"renderers",
")",
";",
"}",
"... | Gets the first renderer in this set
@return SwatCellRenderer the first cell renderer in this set or null if
there are no cell renderers in this set. | [
"Gets",
"the",
"first",
"renderer",
"in",
"this",
"set"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatCellRendererSet.php#L384-L393 |
33,940 | mindkomm/types | lib/Post_Type_Columns.php | Post_Type_Columns.init | public function init() {
add_filter( 'manage_edit-' . $this->post_type . '_columns', [ $this, 'columns' ] );
add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', [ $this, 'columns_sortable' ] );
add_action( 'manage_' . $this->post_type . '_posts_custom_column', [
$this,
'column_content',
]... | php | public function init() {
add_filter( 'manage_edit-' . $this->post_type . '_columns', [ $this, 'columns' ] );
add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', [ $this, 'columns_sortable' ] );
add_action( 'manage_' . $this->post_type . '_posts_custom_column', [
$this,
'column_content',
]... | [
"public",
"function",
"init",
"(",
")",
"{",
"add_filter",
"(",
"'manage_edit-'",
".",
"$",
"this",
"->",
"post_type",
".",
"'_columns'",
",",
"[",
"$",
"this",
",",
"'columns'",
"]",
")",
";",
"add_filter",
"(",
"'manage_edit-'",
".",
"$",
"this",
"->",... | Inits hooks. | [
"Inits",
"hooks",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Columns.php#L59-L66 |
33,941 | mindkomm/types | lib/Post_Type_Columns.php | Post_Type_Columns.columns | public function columns( $columns ) {
foreach ( $this->columns as $slug => $column ) {
// Columns can be removed when they are set to 'false'
if ( false === $column ) {
unset( $columns[ $slug ] );
continue;
}
$columns[ $slug ] = $column['title'];
}
return $columns;
} | php | public function columns( $columns ) {
foreach ( $this->columns as $slug => $column ) {
// Columns can be removed when they are set to 'false'
if ( false === $column ) {
unset( $columns[ $slug ] );
continue;
}
$columns[ $slug ] = $column['title'];
}
return $columns;
} | [
"public",
"function",
"columns",
"(",
"$",
"columns",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"columns",
"as",
"$",
"slug",
"=>",
"$",
"column",
")",
"{",
"// Columns can be removed when they are set to 'false'",
"if",
"(",
"false",
"===",
"$",
"column",
... | Filters columns for post list view.
@param array $columns An array of existing columns.
@return array Filtered array. | [
"Filters",
"columns",
"for",
"post",
"list",
"view",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Columns.php#L75-L87 |
33,942 | mindkomm/types | lib/Post_Type_Columns.php | Post_Type_Columns.columns_sortable | public function columns_sortable( $columns ) {
foreach ( $this->columns as $slug => $column ) {
// Remove column when it’s not sortable.
if ( ! $column['sortable'] ) {
unset( $columns[ $slug ] );
continue;
}
}
return $columns;
} | php | public function columns_sortable( $columns ) {
foreach ( $this->columns as $slug => $column ) {
// Remove column when it’s not sortable.
if ( ! $column['sortable'] ) {
unset( $columns[ $slug ] );
continue;
}
}
return $columns;
} | [
"public",
"function",
"columns_sortable",
"(",
"$",
"columns",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"columns",
"as",
"$",
"slug",
"=>",
"$",
"column",
")",
"{",
"// Remove column when it’s not sortable.",
"if",
"(",
"!",
"$",
"column",
"[",
"'sortabl... | Filters sortable columns.
@param array $columns An array of existing columns.
@return array Filtered array. | [
"Filters",
"sortable",
"columns",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Columns.php#L96-L106 |
33,943 | mindkomm/types | lib/Post_Type_Columns.php | Post_Type_Columns.column_content | public function column_content( $column_name, $post_id ) {
// Bail out.
if ( empty( $this->columns )
|| ! in_array( $column_name, array_keys( $this->columns ), true )
) {
return;
}
$column = $this->columns[ $column_name ];
if ( 'thumbnail' === $column_name ) {
$src = get_the_post_thumbnail_url( $... | php | public function column_content( $column_name, $post_id ) {
// Bail out.
if ( empty( $this->columns )
|| ! in_array( $column_name, array_keys( $this->columns ), true )
) {
return;
}
$column = $this->columns[ $column_name ];
if ( 'thumbnail' === $column_name ) {
$src = get_the_post_thumbnail_url( $... | [
"public",
"function",
"column_content",
"(",
"$",
"column_name",
",",
"$",
"post_id",
")",
"{",
"// Bail out.",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"columns",
")",
"||",
"!",
"in_array",
"(",
"$",
"column_name",
",",
"array_keys",
"(",
"$",
"this... | Update column contents for post list view.
@param string $column_name The column slug.
@param int $post_id The post ID. | [
"Update",
"column",
"contents",
"for",
"post",
"list",
"view",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Type_Columns.php#L114-L159 |
33,944 | silverorange/swat | Swat/SwatInputControl.php | SwatInputControl.getForm | public function getForm()
{
$form = $this->getFirstAncestor('SwatForm');
if ($form === null) {
$path = get_class($this);
$object = $this->parent;
while ($object !== null) {
$path = get_class($object) . '/' . $path;
$object = $object... | php | public function getForm()
{
$form = $this->getFirstAncestor('SwatForm');
if ($form === null) {
$path = get_class($this);
$object = $this->parent;
while ($object !== null) {
$path = get_class($object) . '/' . $path;
$object = $object... | [
"public",
"function",
"getForm",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getFirstAncestor",
"(",
"'SwatForm'",
")",
";",
"if",
"(",
"$",
"form",
"===",
"null",
")",
"{",
"$",
"path",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
... | Gets the form that this control is contained in
You can also get the parent form with the
{@link SwatUIObject::getFirstAncestor()} method but this method is more
convenient and throws an exception .
@return SwatForm the form this control is in.
@throws SwatException | [
"Gets",
"the",
"form",
"that",
"this",
"control",
"is",
"contained",
"in"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatInputControl.php#L63-L81 |
33,945 | silverorange/swat | Swat/SwatInputControl.php | SwatInputControl.getValidationMessage | protected function getValidationMessage($id)
{
switch ($id) {
case 'required':
$text = $this->show_field_title_in_messages
? Swat::_('%s is required.')
: Swat::_('This field is required.');
break;
case 'too-long... | php | protected function getValidationMessage($id)
{
switch ($id) {
case 'required':
$text = $this->show_field_title_in_messages
? Swat::_('%s is required.')
: Swat::_('This field is required.');
break;
case 'too-long... | [
"protected",
"function",
"getValidationMessage",
"(",
"$",
"id",
")",
"{",
"switch",
"(",
"$",
"id",
")",
"{",
"case",
"'required'",
":",
"$",
"text",
"=",
"$",
"this",
"->",
"show_field_title_in_messages",
"?",
"Swat",
"::",
"_",
"(",
"'%s is required.'",
... | Gets a validation message for this control
Can be used by sub-classes to change the validation messages.
@param string $id the string identifier of the validation message.
@return SwatMessage the validation message. | [
"Gets",
"a",
"validation",
"message",
"for",
"this",
"control"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatInputControl.php#L95-L122 |
33,946 | silverorange/swat | Swat/SwatImagePreviewDisplay.php | SwatImagePreviewDisplay.isPreviewDisplayable | protected function isPreviewDisplayable()
{
$image_area = $this->width * $this->height;
$preview_area = $this->preview_width * $this->preview_height;
$difference = ($preview_area - $image_area) / $image_area;
return $this->preview_image != '' &&
($this->show_preview_whe... | php | protected function isPreviewDisplayable()
{
$image_area = $this->width * $this->height;
$preview_area = $this->preview_width * $this->preview_height;
$difference = ($preview_area - $image_area) / $image_area;
return $this->preview_image != '' &&
($this->show_preview_whe... | [
"protected",
"function",
"isPreviewDisplayable",
"(",
")",
"{",
"$",
"image_area",
"=",
"$",
"this",
"->",
"width",
"*",
"$",
"this",
"->",
"height",
";",
"$",
"preview_area",
"=",
"$",
"this",
"->",
"preview_width",
"*",
"$",
"this",
"->",
"preview_height... | Checks whether the preview exists, and whether it should be displayed.
@return boolean True if the preview should be displayed, false if it
should not. | [
"Checks",
"whether",
"the",
"preview",
"exists",
"and",
"whether",
"it",
"should",
"be",
"displayed",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatImagePreviewDisplay.php#L231-L240 |
33,947 | silverorange/swat | Swat/SwatImagePreviewDisplay.php | SwatImagePreviewDisplay.getInlineJavaScript | protected function getInlineJavaScript()
{
static $shown = false;
if (!$shown) {
$javascript = $this->getInlineJavaScriptTranslations();
$shown = true;
} else {
$javascript = '';
}
$javascript .= sprintf(
"var %s = new %s(\n" ... | php | protected function getInlineJavaScript()
{
static $shown = false;
if (!$shown) {
$javascript = $this->getInlineJavaScriptTranslations();
$shown = true;
} else {
$javascript = '';
}
$javascript .= sprintf(
"var %s = new %s(\n" ... | [
"protected",
"function",
"getInlineJavaScript",
"(",
")",
"{",
"static",
"$",
"shown",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"shown",
")",
"{",
"$",
"javascript",
"=",
"$",
"this",
"->",
"getInlineJavaScriptTranslations",
"(",
")",
";",
"$",
"shown",
"... | Gets inline JavaScript required by this image preview.
@return string inline JavaScript needed by this widget. | [
"Gets",
"inline",
"JavaScript",
"required",
"by",
"this",
"image",
"preview",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatImagePreviewDisplay.php#L269-L309 |
33,948 | mindkomm/types | lib/Post_Slug.php | Post_Slug.register | public function register( $post_types = [] ) {
foreach ( $post_types as $post_type => $callback ) {
$this->post_types[ $post_type ] = [
'callback' => $callback,
];
}
} | php | public function register( $post_types = [] ) {
foreach ( $post_types as $post_type => $callback ) {
$this->post_types[ $post_type ] = [
'callback' => $callback,
];
}
} | [
"public",
"function",
"register",
"(",
"$",
"post_types",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"post_types",
"as",
"$",
"post_type",
"=>",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"post_types",
"[",
"$",
"post_type",
"]",
"=",
"[",
"'ca... | Registers post type callbacks.
@param array $post_types An associative array of post types and their callbacks. | [
"Registers",
"post",
"type",
"callbacks",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Slug.php#L30-L36 |
33,949 | mindkomm/types | lib/Post_Slug.php | Post_Slug.register_suffix_date | public function register_suffix_date( $post_types = [] ) {
foreach ( $post_types as $post_type => $args ) {
$this->post_types[ $post_type ] = [
'callback' => function( $post_slug, $post_data, $post_id ) use ( $args ) {
$args = wp_parse_args( $args, [
'meta_key' => 'date_start',
'input_for... | php | public function register_suffix_date( $post_types = [] ) {
foreach ( $post_types as $post_type => $args ) {
$this->post_types[ $post_type ] = [
'callback' => function( $post_slug, $post_data, $post_id ) use ( $args ) {
$args = wp_parse_args( $args, [
'meta_key' => 'date_start',
'input_for... | [
"public",
"function",
"register_suffix_date",
"(",
"$",
"post_types",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"post_types",
"as",
"$",
"post_type",
"=>",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"post_types",
"[",
"$",
"post_type",
"]",
"=",
"["... | Registers date suffixes for post slugs.
@param array $post_types An associative array of post types and their suffix args. | [
"Registers",
"date",
"suffixes",
"for",
"post",
"slugs",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Slug.php#L43-L70 |
33,950 | mindkomm/types | lib/Post_Slug.php | Post_Slug.customize_slug | public function customize_slug( $data, $postarr ) {
$bailout_states = [ 'auto-draft', 'trash' ];
$post_status = $postarr['post_status'];
// Bailout if it’s not the right state.
if ( in_array( $post_status, $bailout_states, true ) ) {
return $data;
}
$post_type = $postarr['post_type'];
// Bailout ... | php | public function customize_slug( $data, $postarr ) {
$bailout_states = [ 'auto-draft', 'trash' ];
$post_status = $postarr['post_status'];
// Bailout if it’s not the right state.
if ( in_array( $post_status, $bailout_states, true ) ) {
return $data;
}
$post_type = $postarr['post_type'];
// Bailout ... | [
"public",
"function",
"customize_slug",
"(",
"$",
"data",
",",
"$",
"postarr",
")",
"{",
"$",
"bailout_states",
"=",
"[",
"'auto-draft'",
",",
"'trash'",
"]",
";",
"$",
"post_status",
"=",
"$",
"postarr",
"[",
"'post_status'",
"]",
";",
"// Bailout if it’s n... | Customizes the post slug.
@param array $data An array of slashed post data.
@param array $postarr An array of sanitized, but otherwise unmodified post data.
@return array | [
"Customizes",
"the",
"post",
"slug",
"."
] | a075d59acf995605427ce8a647a10ed12463b856 | https://github.com/mindkomm/types/blob/a075d59acf995605427ce8a647a10ed12463b856/lib/Post_Slug.php#L80-L112 |
33,951 | brainworxx/kreXX | src/Analyse/Callback/Analyse/BacktraceStep.php | BacktraceStep.callMe | public function callMe()
{
// We are handling the following values here:
// file, line, function, object, type, args, sourcecode.
return $this->dispatchStartEvent() .
$this->fileToOutput() .
$this->lineToOutput() .
$this->functionToOutput() .
$... | php | public function callMe()
{
// We are handling the following values here:
// file, line, function, object, type, args, sourcecode.
return $this->dispatchStartEvent() .
$this->fileToOutput() .
$this->lineToOutput() .
$this->functionToOutput() .
$... | [
"public",
"function",
"callMe",
"(",
")",
"{",
"// We are handling the following values here:",
"// file, line, function, object, type, args, sourcecode.",
"return",
"$",
"this",
"->",
"dispatchStartEvent",
"(",
")",
".",
"$",
"this",
"->",
"fileToOutput",
"(",
")",
".",
... | Renders a backtrace step.
@return string
The generated markup. | [
"Renders",
"a",
"backtrace",
"step",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/BacktraceStep.php#L63-L74 |
33,952 | brainworxx/kreXX | src/Analyse/Callback/Analyse/BacktraceStep.php | BacktraceStep.fileToOutput | protected function fileToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_FILE]) === true) {
return $this->pool->render->renderSingleChild(
$this->dispatchEventWithModel(
__FUNCTION__ . static::EVENT_MARKE... | php | protected function fileToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_FILE]) === true) {
return $this->pool->render->renderSingleChild(
$this->dispatchEventWithModel(
__FUNCTION__ . static::EVENT_MARKE... | [
"protected",
"function",
"fileToOutput",
"(",
")",
"{",
"$",
"stepData",
"=",
"$",
"this",
"->",
"parameters",
"[",
"static",
"::",
"PARAM_DATA",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"stepData",
"[",
"static",
"::",
"TRACE_FILE",
"]",
")",
"===",
"t... | Analyse the 'file' key from the backtrace step.
@return string
The generated dom. | [
"Analyse",
"the",
"file",
"key",
"from",
"the",
"backtrace",
"step",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/BacktraceStep.php#L82-L99 |
33,953 | brainworxx/kreXX | src/Analyse/Callback/Analyse/BacktraceStep.php | BacktraceStep.lineToOutput | protected function lineToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
$output = '';
$source = '';
if (isset($stepData[static::TRACE_LINE]) === true) {
// Adding the line info to the output
$output .= $this->pool->render->renderSingleChild(
... | php | protected function lineToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
$output = '';
$source = '';
if (isset($stepData[static::TRACE_LINE]) === true) {
// Adding the line info to the output
$output .= $this->pool->render->renderSingleChild(
... | [
"protected",
"function",
"lineToOutput",
"(",
")",
"{",
"$",
"stepData",
"=",
"$",
"this",
"->",
"parameters",
"[",
"static",
"::",
"PARAM_DATA",
"]",
";",
"$",
"output",
"=",
"''",
";",
"$",
"source",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
... | Analyse the 'line' key from the backtrace step.
@return string
The generated dom. | [
"Analyse",
"the",
"line",
"key",
"from",
"the",
"backtrace",
"step",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/BacktraceStep.php#L107-L151 |
33,954 | brainworxx/kreXX | src/Analyse/Callback/Analyse/BacktraceStep.php | BacktraceStep.objectToOutput | protected function objectToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_OBJECT]) === true) {
return $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessObject')
->process($this... | php | protected function objectToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_OBJECT]) === true) {
return $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessObject')
->process($this... | [
"protected",
"function",
"objectToOutput",
"(",
")",
"{",
"$",
"stepData",
"=",
"$",
"this",
"->",
"parameters",
"[",
"static",
"::",
"PARAM_DATA",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"stepData",
"[",
"static",
"::",
"TRACE_OBJECT",
"]",
")",
"===",
... | Analyse the 'object' key from the backtrace step.
@return string
The generated dom. | [
"Analyse",
"the",
"object",
"key",
"from",
"the",
"backtrace",
"step",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/BacktraceStep.php#L185-L201 |
33,955 | brainworxx/kreXX | src/Analyse/Callback/Analyse/BacktraceStep.php | BacktraceStep.argsToOutput | protected function argsToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_ARGS]) === true) {
return $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessArray')
->process(
... | php | protected function argsToOutput()
{
$stepData = $this->parameters[static::PARAM_DATA];
if (isset($stepData[static::TRACE_ARGS]) === true) {
return $this->pool
->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessArray')
->process(
... | [
"protected",
"function",
"argsToOutput",
"(",
")",
"{",
"$",
"stepData",
"=",
"$",
"this",
"->",
"parameters",
"[",
"static",
"::",
"PARAM_DATA",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"stepData",
"[",
"static",
"::",
"TRACE_ARGS",
"]",
")",
"===",
"t... | Analyse the 'args' key from the backtrace step.
@return string
The generated dom. | [
"Analyse",
"the",
"args",
"key",
"from",
"the",
"backtrace",
"step",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/BacktraceStep.php#L235-L253 |
33,956 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.setValidRange | public function setValidRange($start_offset, $end_offset)
{
// Beginning of this year
$date = new SwatDate();
$date->setMonth(1);
$date->setDay(1);
$date->setHour(0);
$date->setMinute(0);
$date->setSecond(0);
$date->setTZById('UTC');
$this->va... | php | public function setValidRange($start_offset, $end_offset)
{
// Beginning of this year
$date = new SwatDate();
$date->setMonth(1);
$date->setDay(1);
$date->setHour(0);
$date->setMinute(0);
$date->setSecond(0);
$date->setTZById('UTC');
$this->va... | [
"public",
"function",
"setValidRange",
"(",
"$",
"start_offset",
",",
"$",
"end_offset",
")",
"{",
"// Beginning of this year",
"$",
"date",
"=",
"new",
"SwatDate",
"(",
")",
";",
"$",
"date",
"->",
"setMonth",
"(",
"1",
")",
";",
"$",
"date",
"->",
"set... | Set the valid date range
Convenience method to set the valid date range by year offsets.
@param integer $start_offset offset from the current year in years used
to set the starting year of the valid
range.
@param integer $end_offset offset from the current year in years used
to set the ending year of the valid range. | [
"Set",
"the",
"valid",
"date",
"range"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L163-L180 |
33,957 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.display | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$div_tag = new SwatHtmlTag('div');
$div_tag->id = $this->id;
$div_tag->class = $this->getCSSClassString();
$div_tag->open();
echo '<span class="swat-date-ent... | php | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$div_tag = new SwatHtmlTag('div');
$div_tag->id = $this->id;
$div_tag->class = $this->getCSSClassString();
$div_tag->open();
echo '<span class="swat-date-ent... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"display",
"(",
")",
";",
"$",
"div_tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'div'",
")",
";",
"$",
"div_tag",... | Displays this date entry
Creates internal widgets if they do not exits then displays required
JavaScript, then displays internal widgets. | [
"Displays",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L191-L261 |
33,958 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.isStartDateValid | protected function isStartDateValid()
{
$this->valid_range_start->setTZById('UTC');
return SwatDate::compare(
$this->value,
$this->valid_range_start,
true
) >= 0;
} | php | protected function isStartDateValid()
{
$this->valid_range_start->setTZById('UTC');
return SwatDate::compare(
$this->value,
$this->valid_range_start,
true
) >= 0;
} | [
"protected",
"function",
"isStartDateValid",
"(",
")",
"{",
"$",
"this",
"->",
"valid_range_start",
"->",
"setTZById",
"(",
"'UTC'",
")",
";",
"return",
"SwatDate",
"::",
"compare",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"valid_range_start"... | Checks if the entered date is valid with respect to the valid start
date
@return boolean true if the entered date is on or after the valid start
date and false if the entered date is before the valid
start date. | [
"Checks",
"if",
"the",
"entered",
"date",
"is",
"valid",
"with",
"respect",
"to",
"the",
"valid",
"start",
"date"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L568-L576 |
33,959 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.isEndDateValid | protected function isEndDateValid()
{
$this->valid_range_end->setTZById('UTC');
return SwatDate::compare($this->value, $this->valid_range_end, true) <
0;
} | php | protected function isEndDateValid()
{
$this->valid_range_end->setTZById('UTC');
return SwatDate::compare($this->value, $this->valid_range_end, true) <
0;
} | [
"protected",
"function",
"isEndDateValid",
"(",
")",
"{",
"$",
"this",
"->",
"valid_range_end",
"->",
"setTZById",
"(",
"'UTC'",
")",
";",
"return",
"SwatDate",
"::",
"compare",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"valid_range_end",
",... | Checks if the entered date is valid with respect to the valid end date
@return boolean true if the entered date is before the valid end date
and false if the entered date is on or after the valid
end date. | [
"Checks",
"if",
"the",
"entered",
"date",
"is",
"valid",
"with",
"respect",
"to",
"the",
"valid",
"end",
"date"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L588-L593 |
33,960 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.createCompositeWidgets | protected function createCompositeWidgets()
{
if ($this->display_parts & self::YEAR) {
$this->addCompositeWidget(
$this->createYearFlydown(),
'year_flydown'
);
}
if ($this->display_parts & self::MONTH) {
$this->addComposite... | php | protected function createCompositeWidgets()
{
if ($this->display_parts & self::YEAR) {
$this->addCompositeWidget(
$this->createYearFlydown(),
'year_flydown'
);
}
if ($this->display_parts & self::MONTH) {
$this->addComposite... | [
"protected",
"function",
"createCompositeWidgets",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"display_parts",
"&",
"self",
"::",
"YEAR",
")",
"{",
"$",
"this",
"->",
"addCompositeWidget",
"(",
"$",
"this",
"->",
"createYearFlydown",
"(",
")",
",",
"'yea... | Creates the composite widgets used by this date entry
@see SwatWidget::createCompositeWidgets() | [
"Creates",
"the",
"composite",
"widgets",
"used",
"by",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L637-L664 |
33,961 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.createYearFlydown | protected function createYearFlydown()
{
$flydown = new SwatFlydown($this->id . '_year');
$flydown->classes = array('swat-date-entry-year');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getYearBlankValueTitle();
}
$start_year = $this->valid_ran... | php | protected function createYearFlydown()
{
$flydown = new SwatFlydown($this->id . '_year');
$flydown->classes = array('swat-date-entry-year');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getYearBlankValueTitle();
}
$start_year = $this->valid_ran... | [
"protected",
"function",
"createYearFlydown",
"(",
")",
"{",
"$",
"flydown",
"=",
"new",
"SwatFlydown",
"(",
"$",
"this",
"->",
"id",
".",
"'_year'",
")",
";",
"$",
"flydown",
"->",
"classes",
"=",
"array",
"(",
"'swat-date-entry-year'",
")",
";",
"if",
... | Creates the year flydown for this date entry
@return SwatFlydown the year flydown for this date entry. | [
"Creates",
"the",
"year",
"flydown",
"for",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L674-L697 |
33,962 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.createMonthFlydown | protected function createMonthFlydown()
{
$flydown = new SwatFlydown($this->id . '_month');
$flydown->classes = array('swat-date-entry-month');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getMonthBlankValueTitle();
}
$range_end = clone $this->... | php | protected function createMonthFlydown()
{
$flydown = new SwatFlydown($this->id . '_month');
$flydown->classes = array('swat-date-entry-month');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getMonthBlankValueTitle();
}
$range_end = clone $this->... | [
"protected",
"function",
"createMonthFlydown",
"(",
")",
"{",
"$",
"flydown",
"=",
"new",
"SwatFlydown",
"(",
"$",
"this",
"->",
"id",
".",
"'_month'",
")",
";",
"$",
"flydown",
"->",
"classes",
"=",
"array",
"(",
"'swat-date-entry-month'",
")",
";",
"if",... | Creates the month flydown for this date entry
@return SwatFlydown the month flydown for this date entry. | [
"Creates",
"the",
"month",
"flydown",
"for",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L720-L754 |
33,963 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.getMonthOptionText | protected function getMonthOptionText($month)
{
$text = '';
if ($this->show_month_number) {
$text .= str_pad($month, 2, '0', STR_PAD_LEFT) . ' - ';
}
$date = new SwatDate('2010-' . $month . '-01');
$text .= $date->formatLikeIntl('MMMM');
return $text;
... | php | protected function getMonthOptionText($month)
{
$text = '';
if ($this->show_month_number) {
$text .= str_pad($month, 2, '0', STR_PAD_LEFT) . ' - ';
}
$date = new SwatDate('2010-' . $month . '-01');
$text .= $date->formatLikeIntl('MMMM');
return $text;
... | [
"protected",
"function",
"getMonthOptionText",
"(",
"$",
"month",
")",
"{",
"$",
"text",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"show_month_number",
")",
"{",
"$",
"text",
".=",
"str_pad",
"(",
"$",
"month",
",",
"2",
",",
"'0'",
",",
"STR_PAD... | Gets the title of a month flydown option
@param integer $month the numeric identifier of the month.
@return string the option text of the month. | [
"Gets",
"the",
"title",
"of",
"a",
"month",
"flydown",
"option"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L779-L792 |
33,964 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.createDayFlydown | protected function createDayFlydown()
{
$flydown = new SwatFlydown($this->id . '_day');
$flydown->classes = array('swat-date-entry-day');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getDayBlankValueTitle();
}
// Subtract a second from the end ... | php | protected function createDayFlydown()
{
$flydown = new SwatFlydown($this->id . '_day');
$flydown->classes = array('swat-date-entry-day');
if ($this->show_blank_titles) {
$flydown->blank_title = $this->getDayBlankValueTitle();
}
// Subtract a second from the end ... | [
"protected",
"function",
"createDayFlydown",
"(",
")",
"{",
"$",
"flydown",
"=",
"new",
"SwatFlydown",
"(",
"$",
"this",
"->",
"id",
".",
"'_day'",
")",
";",
"$",
"flydown",
"->",
"classes",
"=",
"array",
"(",
"'swat-date-entry-day'",
")",
";",
"if",
"("... | Creates the day flydown for this date entry
@return SwatFlydown the day flydown for this date entry. | [
"Creates",
"the",
"day",
"flydown",
"for",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L802-L850 |
33,965 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.createCalendar | protected function createCalendar()
{
$calendar = new SwatCalendar($this->id . '_calendar');
$calendar->classes = array('swat-date-entry-calendar');
$calendar->valid_range_start = $this->valid_range_start;
$calendar->valid_range_end = $this->valid_range_end;
return $calendar;... | php | protected function createCalendar()
{
$calendar = new SwatCalendar($this->id . '_calendar');
$calendar->classes = array('swat-date-entry-calendar');
$calendar->valid_range_start = $this->valid_range_start;
$calendar->valid_range_end = $this->valid_range_end;
return $calendar;... | [
"protected",
"function",
"createCalendar",
"(",
")",
"{",
"$",
"calendar",
"=",
"new",
"SwatCalendar",
"(",
"$",
"this",
"->",
"id",
".",
"'_calendar'",
")",
";",
"$",
"calendar",
"->",
"classes",
"=",
"array",
"(",
"'swat-date-entry-calendar'",
")",
";",
... | Creates the calendar widget for this date entry
@return SwatCalendar the calendar widget for this date entry. | [
"Creates",
"the",
"calendar",
"widget",
"for",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L888-L895 |
33,966 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.getFormattedDate | private function getFormattedDate(SwatDate $date)
{
// note: the display of the date is not locale specific as this
// is quite difficult without a good i18n/l10n library
$format = '';
if ($this->display_parts & self::MONTH) {
$format .= ' MMMM';
}
if (... | php | private function getFormattedDate(SwatDate $date)
{
// note: the display of the date is not locale specific as this
// is quite difficult without a good i18n/l10n library
$format = '';
if ($this->display_parts & self::MONTH) {
$format .= ' MMMM';
}
if (... | [
"private",
"function",
"getFormattedDate",
"(",
"SwatDate",
"$",
"date",
")",
"{",
"// note: the display of the date is not locale specific as this",
"// is quite difficult without a good i18n/l10n library",
"$",
"format",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"disp... | Formats a date for this date entry
Returns a date string formatted according to the properties of this
date entry widget. This is used primarily for returning formatted
valid start and valid end dates for user error messages.
@param SwatDate $date the date object to format.
@return string a date formatted according ... | [
"Formats",
"a",
"date",
"for",
"this",
"date",
"entry"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L912-L938 |
33,967 | silverorange/swat | Swat/SwatDateEntry.php | SwatDateEntry.getDatePartOrder | private function getDatePartOrder()
{
$format = nl_langinfo(D_FMT);
// expand short form format
$format = str_replace('%D', '%m/%d/%y', $format);
$day = null;
$month = null;
$year = null;
$matches = array();
if (
preg_match('/(%d|%e)/', ... | php | private function getDatePartOrder()
{
$format = nl_langinfo(D_FMT);
// expand short form format
$format = str_replace('%D', '%m/%d/%y', $format);
$day = null;
$month = null;
$year = null;
$matches = array();
if (
preg_match('/(%d|%e)/', ... | [
"private",
"function",
"getDatePartOrder",
"(",
")",
"{",
"$",
"format",
"=",
"nl_langinfo",
"(",
"D_FMT",
")",
";",
"// expand short form format",
"$",
"format",
"=",
"str_replace",
"(",
"'%D'",
",",
"'%m/%d/%y'",
",",
"$",
"format",
")",
";",
"$",
"day",
... | Gets the order of date parts for the current locale
Note: The technique used within this method does not work correcty for
RTL languages that display month names, month abbreviations or weekday
names. Since we're displaying months textually these locales may have
date parts incorrectly ordered.
@return array an array... | [
"Gets",
"the",
"order",
"of",
"date",
"parts",
"for",
"the",
"current",
"locale"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDateEntry.php#L954-L1005 |
33,968 | silverorange/swat | Swat/SwatImageButton.php | SwatImageButton.display | public function display()
{
if (!$this->visible) {
return;
}
SwatWidget::display();
if ($this->alt == '') {
throw new SwatException(
'The $alt property of SwatImageButton must be set to an ' .
'appropriate value. The "alt"... | php | public function display()
{
if (!$this->visible) {
return;
}
SwatWidget::display();
if ($this->alt == '') {
throw new SwatException(
'The $alt property of SwatImageButton must be set to an ' .
'appropriate value. The "alt"... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"SwatWidget",
"::",
"display",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"alt",
"==",
"''",
")",
"{",
"throw",
"new",
... | Displays this image button
Outputs an XHTML input tag. | [
"Displays",
"this",
"image",
"button"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatImageButton.php#L80-L125 |
33,969 | spiral/hmvc | src/Controller.php | Controller.isExecutable | protected function isExecutable(\ReflectionMethod $method)
{
if ($method->isStatic() || $method->getDeclaringClass()->getName() == self::class) {
return false;
}
//Place to implement custom logic
return true;
} | php | protected function isExecutable(\ReflectionMethod $method)
{
if ($method->isStatic() || $method->getDeclaringClass()->getName() == self::class) {
return false;
}
//Place to implement custom logic
return true;
} | [
"protected",
"function",
"isExecutable",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"if",
"(",
"$",
"method",
"->",
"isStatic",
"(",
")",
"||",
"$",
"method",
"->",
"getDeclaringClass",
"(",
")",
"->",
"getName",
"(",
")",
"==",
"self",
"::"... | Check if method is callable.
@param \ReflectionMethod $method
@return bool | [
"Check",
"if",
"method",
"is",
"callable",
"."
] | 141d876977bf36b5be5038d4db1193e8cd9eddc3 | https://github.com/spiral/hmvc/blob/141d876977bf36b5be5038d4db1193e8cd9eddc3/src/Controller.php#L92-L100 |
33,970 | spiral/hmvc | src/Controller.php | Controller.resolveArguments | protected function resolveArguments(
ContainerInterface $container,
\ReflectionMethod $method,
array $parameters
) {
try {
//Getting set of arguments should be sent to requested method
return $container->get(ResolverInterface::class)->resolveArguments(
... | php | protected function resolveArguments(
ContainerInterface $container,
\ReflectionMethod $method,
array $parameters
) {
try {
//Getting set of arguments should be sent to requested method
return $container->get(ResolverInterface::class)->resolveArguments(
... | [
"protected",
"function",
"resolveArguments",
"(",
"ContainerInterface",
"$",
"container",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"array",
"$",
"parameters",
")",
"{",
"try",
"{",
"//Getting set of arguments should be sent to requested method",
"return",
"$",
... | Resolve controller method arguments.
@param ContainerInterface $container
@param \ReflectionMethod $method
@param array $parameters
@return array | [
"Resolve",
"controller",
"method",
"arguments",
"."
] | 141d876977bf36b5be5038d4db1193e8cd9eddc3 | https://github.com/spiral/hmvc/blob/141d876977bf36b5be5038d4db1193e8cd9eddc3/src/Controller.php#L111-L130 |
33,971 | rhoone/yii2-rhoone | base/DictionaryHelperTrait.php | DictionaryHelperTrait.add | public static function add($extension, $dictionary = null)
{
$extension = ExtensionManager::validate($extension);
if ($dictionary === null) {
$dictionary = $extension->getDictionary();
}
$dictionary = static::validate($dictionary);
if (empty($dictionary)) {
... | php | public static function add($extension, $dictionary = null)
{
$extension = ExtensionManager::validate($extension);
if ($dictionary === null) {
$dictionary = $extension->getDictionary();
}
$dictionary = static::validate($dictionary);
if (empty($dictionary)) {
... | [
"public",
"static",
"function",
"add",
"(",
"$",
"extension",
",",
"$",
"dictionary",
"=",
"null",
")",
"{",
"$",
"extension",
"=",
"ExtensionManager",
"::",
"validate",
"(",
"$",
"extension",
")",
";",
"if",
"(",
"$",
"dictionary",
"===",
"null",
")",
... | Add dictionary to extension.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension $extension
@param array|\rhoone\extension\Dictionary|string|\rhoone\extension\Extension|null $dictionary | [
"Add",
"dictionary",
"to",
"extension",
"."
] | f6ae90d466ea6f34bba404be0aba03e37ef369ad | https://github.com/rhoone/yii2-rhoone/blob/f6ae90d466ea6f34bba404be0aba03e37ef369ad/base/DictionaryHelperTrait.php#L32-L62 |
33,972 | silverorange/swat | Swat/SwatDetailsViewField.php | SwatDetailsViewField.displayValue | public function displayValue($data)
{
if (count($this->renderers) === 0) {
throw new SwatException(
'No renderer has been provided for this field.'
);
}
$sensitive = $this->view->isSensitive();
// Set the properties of the renderers to the va... | php | public function displayValue($data)
{
if (count($this->renderers) === 0) {
throw new SwatException(
'No renderer has been provided for this field.'
);
}
$sensitive = $this->view->isSensitive();
// Set the properties of the renderers to the va... | [
"public",
"function",
"displayValue",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"renderers",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"SwatException",
"(",
"'No renderer has been provided for this field.'",
")",
";",
"}",
"$",... | Displays the value of this details view field
The properties of the cell renderers are set from the data object
through the datafield property mappings.
@param mixed $data the data object to display in this field. | [
"Displays",
"the",
"value",
"of",
"this",
"details",
"view",
"field"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsViewField.php#L182-L199 |
33,973 | silverorange/swat | Swat/SwatDetailsViewField.php | SwatDetailsViewField.getHeaderTitle | protected function getHeaderTitle()
{
if ($this->title == '') {
$header_title = ' ';
} else {
$header_title = $this->show_colon
? sprintf(Swat::_('%s:'), $this->title)
: $this->title;
}
return $header_title;
} | php | protected function getHeaderTitle()
{
if ($this->title == '') {
$header_title = ' ';
} else {
$header_title = $this->show_colon
? sprintf(Swat::_('%s:'), $this->title)
: $this->title;
}
return $header_title;
} | [
"protected",
"function",
"getHeaderTitle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"title",
"==",
"''",
")",
"{",
"$",
"header_title",
"=",
"' '",
";",
"}",
"else",
"{",
"$",
"header_title",
"=",
"$",
"this",
"->",
"show_colon",
"?",
"sprintf... | Gets the title to use for the header of this details view field.
@return string the title to use for the header.
@see SwatDetailsViewField::displayHeader() | [
"Gets",
"the",
"title",
"to",
"use",
"for",
"the",
"header",
"of",
"this",
"details",
"view",
"field",
"."
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsViewField.php#L275-L286 |
33,974 | silverorange/swat | Swat/SwatDetailsViewField.php | SwatDetailsViewField.getCSSClassNames | protected function getCSSClassNames()
{
// base classes
$classes = $this->getBaseCSSClassNames();
// odd
if ($this->odd) {
$classes[] = 'odd';
}
// user-specified classes
$classes = array_merge($classes, $this->classes);
$first_renderer ... | php | protected function getCSSClassNames()
{
// base classes
$classes = $this->getBaseCSSClassNames();
// odd
if ($this->odd) {
$classes[] = 'odd';
}
// user-specified classes
$classes = array_merge($classes, $this->classes);
$first_renderer ... | [
"protected",
"function",
"getCSSClassNames",
"(",
")",
"{",
"// base classes",
"$",
"classes",
"=",
"$",
"this",
"->",
"getBaseCSSClassNames",
"(",
")",
";",
"// odd",
"if",
"(",
"$",
"this",
"->",
"odd",
")",
"{",
"$",
"classes",
"[",
"]",
"=",
"'odd'",... | Gets the array of CSS classes that are applied to this details-view
field
CSS classes are added to this field in the following order:
1. hard-coded CSS classes from field subclasses,
2. 'odd' if this is an odd row in the parent view,
3. user-specified CSS classes on this field,
If {@link SwatDetailsViewField::$show_... | [
"Gets",
"the",
"array",
"of",
"CSS",
"classes",
"that",
"are",
"applied",
"to",
"this",
"details",
"-",
"view",
"field"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsViewField.php#L345-L388 |
33,975 | rinvex/cortex-tags | src/Http/Controllers/Adminarea/TagsController.php | TagsController.import | public function import(Tag $tag, ImportRecordsDataTable $importRecordsDataTable)
{
return $importRecordsDataTable->with([
'resource' => $tag,
'tabs' => 'adminarea.tags.tabs',
'url' => route('adminarea.tags.stash'),
'id' => "adminarea-tags-{$tag->getRouteKey()}... | php | public function import(Tag $tag, ImportRecordsDataTable $importRecordsDataTable)
{
return $importRecordsDataTable->with([
'resource' => $tag,
'tabs' => 'adminarea.tags.tabs',
'url' => route('adminarea.tags.stash'),
'id' => "adminarea-tags-{$tag->getRouteKey()}... | [
"public",
"function",
"import",
"(",
"Tag",
"$",
"tag",
",",
"ImportRecordsDataTable",
"$",
"importRecordsDataTable",
")",
"{",
"return",
"$",
"importRecordsDataTable",
"->",
"with",
"(",
"[",
"'resource'",
"=>",
"$",
"tag",
",",
"'tabs'",
"=>",
"'adminarea.tags... | Import tags.
@param \Cortex\Tags\Models\Tag $tag
@param \Cortex\Foundation\DataTables\ImportRecordsDataTable $importRecordsDataTable
@return \Illuminate\View\View | [
"Import",
"tags",
"."
] | 270c8682e14978143b2e801113c2ad5b608a5158 | https://github.com/rinvex/cortex-tags/blob/270c8682e14978143b2e801113c2ad5b608a5158/src/Http/Controllers/Adminarea/TagsController.php#L65-L73 |
33,976 | rinvex/cortex-tags | src/Http/Controllers/Adminarea/TagsController.php | TagsController.destroy | public function destroy(Tag $tag)
{
$tag->delete();
return intend([
'url' => route('adminarea.tags.index'),
'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/tags::common.tag'), 'identifier' => $tag->name])],
]... | php | public function destroy(Tag $tag)
{
$tag->delete();
return intend([
'url' => route('adminarea.tags.index'),
'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/tags::common.tag'), 'identifier' => $tag->name])],
]... | [
"public",
"function",
"destroy",
"(",
"Tag",
"$",
"tag",
")",
"{",
"$",
"tag",
"->",
"delete",
"(",
")",
";",
"return",
"intend",
"(",
"[",
"'url'",
"=>",
"route",
"(",
"'adminarea.tags.index'",
")",
",",
"'with'",
"=>",
"[",
"'warning'",
"=>",
"trans"... | Destroy given tag.
@param \Cortex\Tags\Models\Tag $tag
@throws \Exception
@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse | [
"Destroy",
"given",
"tag",
"."
] | 270c8682e14978143b2e801113c2ad5b608a5158 | https://github.com/rinvex/cortex-tags/blob/270c8682e14978143b2e801113c2ad5b608a5158/src/Http/Controllers/Adminarea/TagsController.php#L208-L216 |
33,977 | brainworxx/kreXX | src/Analyse/Callback/Iterate/ThroughConfig.php | ThroughConfig.callMe | public function callMe()
{
$configOutput = $this->dispatchStartEvent();
// We need to "explode" our config array into the
// sections again, for better readability.
$sections = array();
foreach ($this->pool->config->settings as $name => $setting) {
$sections[$set... | php | public function callMe()
{
$configOutput = $this->dispatchStartEvent();
// We need to "explode" our config array into the
// sections again, for better readability.
$sections = array();
foreach ($this->pool->config->settings as $name => $setting) {
$sections[$set... | [
"public",
"function",
"callMe",
"(",
")",
"{",
"$",
"configOutput",
"=",
"$",
"this",
"->",
"dispatchStartEvent",
"(",
")",
";",
"// We need to \"explode\" our config array into the",
"// sections again, for better readability.",
"$",
"sections",
"=",
"array",
"(",
")",... | Renders whole configuration.
@return string
The generated markup. | [
"Renders",
"whole",
"configuration",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Iterate/ThroughConfig.php#L61-L105 |
33,978 | brainworxx/kreXX | src/Analyse/Callback/Analyse/Objects/PrivateProperties.php | PrivateProperties.callMe | public function callMe()
{
$output = $this->dispatchStartEvent();
$refProps = array();
/** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */
$ref = $this->parameters[static::PARAM_REF];
// We need to keep the original reference intact.
$reflectionClas... | php | public function callMe()
{
$output = $this->dispatchStartEvent();
$refProps = array();
/** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */
$ref = $this->parameters[static::PARAM_REF];
// We need to keep the original reference intact.
$reflectionClas... | [
"public",
"function",
"callMe",
"(",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"dispatchStartEvent",
"(",
")",
";",
"$",
"refProps",
"=",
"array",
"(",
")",
";",
"/** @var \\Brainworxx\\Krexx\\Service\\Reflection\\ReflectionClass $ref */",
"$",
"ref",
"=",
... | Dumping all private properties.
@return string
The generated HTML markup | [
"Dumping",
"all",
"private",
"properties",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Analyse/Objects/PrivateProperties.php#L62-L94 |
33,979 | brainworxx/kreXX | src/Service/Config/From/Cookie.php | Cookie.getConfigFromCookies | public function getConfigFromCookies($group, $name)
{
// Do we have a value in the cookies?
if (isset($this->settings[$name]) === true &&
$this->security->evaluateSetting($group, $name, $this->settings[$name]) === true
) {
// We escape them, just in case.
... | php | public function getConfigFromCookies($group, $name)
{
// Do we have a value in the cookies?
if (isset($this->settings[$name]) === true &&
$this->security->evaluateSetting($group, $name, $this->settings[$name]) === true
) {
// We escape them, just in case.
... | [
"public",
"function",
"getConfigFromCookies",
"(",
"$",
"group",
",",
"$",
"name",
")",
"{",
"// Do we have a value in the cookies?",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"settings",
"[",
"$",
"name",
"]",
")",
"===",
"true",
"&&",
"$",
"this",
"->"... | Returns settings from the local cookies.
@param string $group
The name of the group inside the cookie.
@param string $name
The name of the value.
@return string|null
The value. | [
"Returns",
"settings",
"from",
"the",
"local",
"cookies",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Service/Config/From/Cookie.php#L91-L103 |
33,980 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.display | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$table_tag = new SwatHtmlTag('table');
$table_tag->id = $this->id;
$table_tag->class = $this->getCSSClassString();
$table_tag->open();
$this->displayContent(... | php | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$table_tag = new SwatHtmlTag('table');
$table_tag->id = $this->id;
$table_tag->class = $this->getCSSClassString();
$table_tag->open();
$this->displayContent(... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"display",
"(",
")",
";",
"$",
"table_tag",
"=",
"new",
"SwatHtmlTag",
"(",
"'table'",
")",
";",
"$",
"table... | Displays this details view
Displays details view as tabular XHTML. | [
"Displays",
"this",
"details",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L110-L127 |
33,981 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.insertFieldBefore | public function insertFieldBefore(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field
) {
$this->insertField($field, $reference_field, false);
} | php | public function insertFieldBefore(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field
) {
$this->insertField($field, $reference_field, false);
} | [
"public",
"function",
"insertFieldBefore",
"(",
"SwatDetailsViewField",
"$",
"field",
",",
"SwatDetailsViewField",
"$",
"reference_field",
")",
"{",
"$",
"this",
"->",
"insertField",
"(",
"$",
"field",
",",
"$",
"reference_field",
",",
"false",
")",
";",
"}"
] | Inserts a field before an existing field in this details-view
@param SwatDetailsViewField $field the field to insert.
@param SwatDetailsViewField $reference_field the field before which the
field will be inserted.
@throws SwatWidgetNotFoundException if the reference field does not
exist in this details-view.
@throws ... | [
"Inserts",
"a",
"field",
"before",
"an",
"existing",
"field",
"in",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L162-L167 |
33,982 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.insertFieldAfter | public function insertFieldAfter(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field
) {
$this->insertField($field, $reference_field, true);
} | php | public function insertFieldAfter(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field
) {
$this->insertField($field, $reference_field, true);
} | [
"public",
"function",
"insertFieldAfter",
"(",
"SwatDetailsViewField",
"$",
"field",
",",
"SwatDetailsViewField",
"$",
"reference_field",
")",
"{",
"$",
"this",
"->",
"insertField",
"(",
"$",
"field",
",",
"$",
"reference_field",
",",
"true",
")",
";",
"}"
] | Inserts a field after an existing field in this details-view
@param SwatDetailsViewField $field the field to insert.
@param SwatDetailsViewField $reference_field the field after which the
field will be inserted.
@throws SwatWidgetNotFoundException if the reference field does not
exist in this details-view.
@throws Sw... | [
"Inserts",
"a",
"field",
"after",
"an",
"existing",
"field",
"in",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L184-L189 |
33,983 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.getField | public function getField($id)
{
if (!array_key_exists($id, $this->fields_by_id)) {
throw new SwatWidgetNotFoundException(
"Field with an id of '{$id}' not found."
);
}
return $this->fields_by_id[$id];
} | php | public function getField($id)
{
if (!array_key_exists($id, $this->fields_by_id)) {
throw new SwatWidgetNotFoundException(
"Field with an id of '{$id}' not found."
);
}
return $this->fields_by_id[$id];
} | [
"public",
"function",
"getField",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"fields_by_id",
")",
")",
"{",
"throw",
"new",
"SwatWidgetNotFoundException",
"(",
"\"Field with an id of '{$id}' not found.\"... | Gets a field in this details view by the field's id
@param string $id the id of the field in this details-view to get.
@return SwatDetailsViewField the field in this details-view with the
specified id.
@throws SwatWidgetNotFoundException if no field with the given id exists
in this details view. | [
"Gets",
"a",
"field",
"in",
"this",
"details",
"view",
"by",
"the",
"field",
"s",
"id"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L231-L240 |
33,984 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.addChild | public function addChild(SwatObject $child)
{
if ($child instanceof SwatDetailsViewField) {
$this->appendField($child);
} else {
$class_name = get_class($child);
throw new SwatInvalidClassException(
"Unable to add '{$class_name}' object to SwatDet... | php | public function addChild(SwatObject $child)
{
if ($child instanceof SwatDetailsViewField) {
$this->appendField($child);
} else {
$class_name = get_class($child);
throw new SwatInvalidClassException(
"Unable to add '{$class_name}' object to SwatDet... | [
"public",
"function",
"addChild",
"(",
"SwatObject",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"instanceof",
"SwatDetailsViewField",
")",
"{",
"$",
"this",
"->",
"appendField",
"(",
"$",
"child",
")",
";",
"}",
"else",
"{",
"$",
"class_name",
"=",... | Adds a child object to this object
@param SwatDetailsViewField $child the child object to add to this
object.
@throws SwatInvalidClassException
@see SwatUIParent::addChild() | [
"Adds",
"a",
"child",
"object",
"to",
"this",
"object"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L270-L285 |
33,985 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.getHtmlHeadEntrySet | public function getHtmlHeadEntrySet()
{
$set = parent::getHtmlHeadEntrySet();
foreach ($this->fields as $field) {
$set->addEntrySet($field->getHtmlHeadEntrySet());
}
return $set;
} | php | public function getHtmlHeadEntrySet()
{
$set = parent::getHtmlHeadEntrySet();
foreach ($this->fields as $field) {
$set->addEntrySet($field->getHtmlHeadEntrySet());
}
return $set;
} | [
"public",
"function",
"getHtmlHeadEntrySet",
"(",
")",
"{",
"$",
"set",
"=",
"parent",
"::",
"getHtmlHeadEntrySet",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"set",
"->",
"addEntrySet",
"(",
"$",
"fi... | Gets the SwatHtmlHeadEntry objects needed by this details-view
@return SwatHtmlHeadEntrySet the SwatHtmlHeadEntry objects needed by
this details-view.
@see SwatUIObject::getHtmlHeadEntrySet() | [
"Gets",
"the",
"SwatHtmlHeadEntry",
"objects",
"needed",
"by",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L298-L307 |
33,986 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.getAvailableHtmlHeadEntrySet | public function getAvailableHtmlHeadEntrySet()
{
$set = parent::getAvailableHtmlHeadEntrySet();
foreach ($this->fields as $field) {
$set->addEntrySet($field->getAvailableHtmlHeadEntrySet());
}
return $set;
} | php | public function getAvailableHtmlHeadEntrySet()
{
$set = parent::getAvailableHtmlHeadEntrySet();
foreach ($this->fields as $field) {
$set->addEntrySet($field->getAvailableHtmlHeadEntrySet());
}
return $set;
} | [
"public",
"function",
"getAvailableHtmlHeadEntrySet",
"(",
")",
"{",
"$",
"set",
"=",
"parent",
"::",
"getAvailableHtmlHeadEntrySet",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"set",
"->",
"addEntrySet",
... | Gets the SwatHtmlHeadEntry objects that may be needed by this
details-view
@return SwatHtmlHeadEntrySet the SwatHtmlHeadEntry objects that may be
needed by this details-view.
@see SwatUIObject::getAvailableHtmlHeadEntrySet() | [
"Gets",
"the",
"SwatHtmlHeadEntry",
"objects",
"that",
"may",
"be",
"needed",
"by",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L321-L330 |
33,987 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.validateField | protected function validateField(SwatDetailsViewField $field)
{
// note: This works because the id property is set before children are
// added to parents in SwatUI.
if ($field->id !== null) {
if (array_key_exists($field->id, $this->fields_by_id)) {
throw new Swat... | php | protected function validateField(SwatDetailsViewField $field)
{
// note: This works because the id property is set before children are
// added to parents in SwatUI.
if ($field->id !== null) {
if (array_key_exists($field->id, $this->fields_by_id)) {
throw new Swat... | [
"protected",
"function",
"validateField",
"(",
"SwatDetailsViewField",
"$",
"field",
")",
"{",
"// note: This works because the id property is set before children are",
"// added to parents in SwatUI.",
"if",
"(",
"$",
"field",
"->",
"id",
"!==",
"null",
")",
"{",
"if",
"... | Ensures a field added to this details-view is valid for this
details-view
@param SwatDetailsViewField $field the field to check.
@throws SwatDuplicateIdException if the field has the same id as a
field already in this details-view. | [
"Ensures",
"a",
"field",
"added",
"to",
"this",
"details",
"-",
"view",
"is",
"valid",
"for",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L504-L518 |
33,988 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.insertField | protected function insertField(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field = null,
$after = true
) {
$this->validateField($field);
if ($reference_field !== null) {
$key = array_search($reference_field, $this->fields, true);
if... | php | protected function insertField(
SwatDetailsViewField $field,
SwatDetailsViewField $reference_field = null,
$after = true
) {
$this->validateField($field);
if ($reference_field !== null) {
$key = array_search($reference_field, $this->fields, true);
if... | [
"protected",
"function",
"insertField",
"(",
"SwatDetailsViewField",
"$",
"field",
",",
"SwatDetailsViewField",
"$",
"reference_field",
"=",
"null",
",",
"$",
"after",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"validateField",
"(",
"$",
"field",
")",
";",
"i... | Helper method to insert fields into this details-view
@param SwatDetailsViewField $field the field to insert.
@param SwatDetailsViewField $reference_field optional. An existing field
within this details-view to
which the inserted field
is relatively positioned.
If not specified, the
field is inserted at the
beginning ... | [
"Helper",
"method",
"to",
"insert",
"fields",
"into",
"this",
"details",
"-",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L557-L603 |
33,989 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.getInlineJavaScript | protected function getInlineJavaScript()
{
$javascript = '';
foreach ($this->fields as $field) {
$field_javascript = $field->getRendererInlineJavaScript();
if ($field_javascript != '') {
$javascript .= "\n" . $field_javascript;
}
}
... | php | protected function getInlineJavaScript()
{
$javascript = '';
foreach ($this->fields as $field) {
$field_javascript = $field->getRendererInlineJavaScript();
if ($field_javascript != '') {
$javascript .= "\n" . $field_javascript;
}
}
... | [
"protected",
"function",
"getInlineJavaScript",
"(",
")",
"{",
"$",
"javascript",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"field_javascript",
"=",
"$",
"field",
"->",
"getRendererInlineJavaScript",
"(",... | Gets the inline JavaScript needed by this details view as well as any
inline JavaScript needed by fields
@return string inline JavaScript needed by this details view. | [
"Gets",
"the",
"inline",
"JavaScript",
"needed",
"by",
"this",
"details",
"view",
"as",
"well",
"as",
"any",
"inline",
"JavaScript",
"needed",
"by",
"fields"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L630-L649 |
33,990 | silverorange/swat | Swat/SwatDetailsView.php | SwatDetailsView.displayContent | protected function displayContent()
{
$count = 1;
foreach ($this->fields as $field) {
$odd = $count % 2 === 1;
ob_start();
$field->display($this->data, $odd);
$content = ob_get_clean();
if ($content != '') {
echo $content... | php | protected function displayContent()
{
$count = 1;
foreach ($this->fields as $field) {
$odd = $count % 2 === 1;
ob_start();
$field->display($this->data, $odd);
$content = ob_get_clean();
if ($content != '') {
echo $content... | [
"protected",
"function",
"displayContent",
"(",
")",
"{",
"$",
"count",
"=",
"1",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"odd",
"=",
"$",
"count",
"%",
"2",
"===",
"1",
";",
"ob_start",
"(",
")",
";",... | Displays each field of this view
Displays each field of this view as an XHTML table row. | [
"Displays",
"each",
"field",
"of",
"this",
"view"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDetailsView.php#L659-L675 |
33,991 | brainworxx/kreXX | src/Analyse/Callback/Iterate/ThroughLargeArray.php | ThroughLargeArray.handleKey | protected function handleKey($key, Model $model)
{
if (is_string($key) === true) {
$model->setName($this->pool->encodingService->encodeString($key))
->setConnectorType(Connectors::ASSOCIATIVE_ARRAY);
return;
}
$model->setName($key)->setConnectorType(... | php | protected function handleKey($key, Model $model)
{
if (is_string($key) === true) {
$model->setName($this->pool->encodingService->encodeString($key))
->setConnectorType(Connectors::ASSOCIATIVE_ARRAY);
return;
}
$model->setName($key)->setConnectorType(... | [
"protected",
"function",
"handleKey",
"(",
"$",
"key",
",",
"Model",
"$",
"model",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
"===",
"true",
")",
"{",
"$",
"model",
"->",
"setName",
"(",
"$",
"this",
"->",
"pool",
"->",
"encodingService"... | Adding quotation marks and a connector, depending on the type
of the key.
@param integer|string $key
The key (or name) of what we are analysing.
@param Model $model
The so far prepared model we are preparing further. | [
"Adding",
"quotation",
"marks",
"and",
"a",
"connector",
"depending",
"on",
"the",
"type",
"of",
"the",
"key",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Iterate/ThroughLargeArray.php#L119-L129 |
33,992 | brainworxx/kreXX | src/Analyse/Callback/Iterate/ThroughLargeArray.php | ThroughLargeArray.handleValue | protected function handleValue($value, Model $model)
{
if (is_object($value) === true) {
// We will not go too deep here, and say only what it is.
$model->setType(static::TYPE_SIMPLE_CLASS)
->setNormal(get_class($value));
return $this->pool->render->rende... | php | protected function handleValue($value, Model $model)
{
if (is_object($value) === true) {
// We will not go too deep here, and say only what it is.
$model->setType(static::TYPE_SIMPLE_CLASS)
->setNormal(get_class($value));
return $this->pool->render->rende... | [
"protected",
"function",
"handleValue",
"(",
"$",
"value",
",",
"Model",
"$",
"model",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"===",
"true",
")",
"{",
"// We will not go too deep here, and say only what it is.",
"$",
"model",
"->",
"setType",
... | Starting the analysis of the value.
@param mixed $value
The value from the current array position.
@param Model $model
The so far prepared model.
@return string
The generated markup | [
"Starting",
"the",
"analysis",
"of",
"the",
"value",
"."
] | a03beaa4507ffb391412b9ac61593d263d3f8bca | https://github.com/brainworxx/kreXX/blob/a03beaa4507ffb391412b9ac61593d263d3f8bca/src/Analyse/Callback/Iterate/ThroughLargeArray.php#L141-L162 |
33,993 | silverorange/swat | Swat/SwatDisplayableContainer.php | SwatDisplayableContainer.display | public function display()
{
if (!$this->visible) {
return;
}
SwatWidget::display();
$div = new SwatHtmlTag('div');
$div->id = $this->id;
$div->class = $this->getCSSClassString();
$div->open();
$this->displayChildren();
$div->clos... | php | public function display()
{
if (!$this->visible) {
return;
}
SwatWidget::display();
$div = new SwatHtmlTag('div');
$div->id = $this->id;
$div->class = $this->getCSSClassString();
$div->open();
$this->displayChildren();
$div->clos... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"SwatWidget",
"::",
"display",
"(",
")",
";",
"$",
"div",
"=",
"new",
"SwatHtmlTag",
"(",
"'div'",
")",
";",
"$",
"div",
"... | Displays this container | [
"Displays",
"this",
"container"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatDisplayableContainer.php#L17-L32 |
33,994 | zeroem/ZeroemCurlBundle | Curl/Request.php | Request.setOption | public function setOption($option, $value) {
if(CurlOptions::checkOptionValue($option,$value)) {
return curl_setopt($this->handle, $option, $value);
}
} | php | public function setOption($option, $value) {
if(CurlOptions::checkOptionValue($option,$value)) {
return curl_setopt($this->handle, $option, $value);
}
} | [
"public",
"function",
"setOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"if",
"(",
"CurlOptions",
"::",
"checkOptionValue",
"(",
"$",
"option",
",",
"$",
"value",
")",
")",
"{",
"return",
"curl_setopt",
"(",
"$",
"this",
"->",
"handle",
","... | Alias of the curl_setopt function | [
"Alias",
"of",
"the",
"curl_setopt",
"function"
] | 1045e2093bec5a013ff9458828721e581725f1a0 | https://github.com/zeroem/ZeroemCurlBundle/blob/1045e2093bec5a013ff9458828721e581725f1a0/Curl/Request.php#L61-L65 |
33,995 | zeroem/ZeroemCurlBundle | Curl/Request.php | Request.setOptionArray | public function setOptionArray(array $arr) {
foreach($arr as $option => $value) {
CurlOptions::checkOptionValue($option, $value);
}
return curl_setopt_array($this->handle, $arr);
} | php | public function setOptionArray(array $arr) {
foreach($arr as $option => $value) {
CurlOptions::checkOptionValue($option, $value);
}
return curl_setopt_array($this->handle, $arr);
} | [
"public",
"function",
"setOptionArray",
"(",
"array",
"$",
"arr",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"CurlOptions",
"::",
"checkOptionValue",
"(",
"$",
"option",
",",
"$",
"value",
")",
";",
"}",
... | Alias of the curl_setopt_array function | [
"Alias",
"of",
"the",
"curl_setopt_array",
"function"
] | 1045e2093bec5a013ff9458828721e581725f1a0 | https://github.com/zeroem/ZeroemCurlBundle/blob/1045e2093bec5a013ff9458828721e581725f1a0/Curl/Request.php#L70-L76 |
33,996 | zeroem/ZeroemCurlBundle | Curl/Request.php | Request.getInfo | public function getInfo($flag=null) {
if(isset($flag)) {
return curl_getinfo($this->handle,$flag);
} else {
return curl_getinfo($this->handle);
}
} | php | public function getInfo($flag=null) {
if(isset($flag)) {
return curl_getinfo($this->handle,$flag);
} else {
return curl_getinfo($this->handle);
}
} | [
"public",
"function",
"getInfo",
"(",
"$",
"flag",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"flag",
")",
")",
"{",
"return",
"curl_getinfo",
"(",
"$",
"this",
"->",
"handle",
",",
"$",
"flag",
")",
";",
"}",
"else",
"{",
"return",
"cu... | Alias of the curl_getinfo function | [
"Alias",
"of",
"the",
"curl_getinfo",
"function"
] | 1045e2093bec5a013ff9458828721e581725f1a0 | https://github.com/zeroem/ZeroemCurlBundle/blob/1045e2093bec5a013ff9458828721e581725f1a0/Curl/Request.php#L103-L109 |
33,997 | zeroem/ZeroemCurlBundle | Curl/Request.php | Request.setMethod | public function setMethod($method) {
if (isset(static::$_methodOptionMap[$method])) {
return $this->setOption(static::$_methodOptionMap[$method],true);
} else {
return $this->setOption(CURLOPT_CUSTOMREQUEST,$method);
}
} | php | public function setMethod($method) {
if (isset(static::$_methodOptionMap[$method])) {
return $this->setOption(static::$_methodOptionMap[$method],true);
} else {
return $this->setOption(CURLOPT_CUSTOMREQUEST,$method);
}
} | [
"public",
"function",
"setMethod",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"_methodOptionMap",
"[",
"$",
"method",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"setOption",
"(",
"static",
"::",
"$",
"_methodOptio... | Convenience method for setting the appropriate cURL options based on the desired
HTTP request method
@param resource $handle the curl handle
@param Request $request the Request object we're populating | [
"Convenience",
"method",
"for",
"setting",
"the",
"appropriate",
"cURL",
"options",
"based",
"on",
"the",
"desired",
"HTTP",
"request",
"method"
] | 1045e2093bec5a013ff9458828721e581725f1a0 | https://github.com/zeroem/ZeroemCurlBundle/blob/1045e2093bec5a013ff9458828721e581725f1a0/Curl/Request.php#L118-L124 |
33,998 | silverorange/swat | Swat/SwatConfirmEmailEntry.php | SwatConfirmEmailEntry.process | public function process()
{
parent::process();
if ($this->value === null) {
return;
}
if ($this->email_widget === null) {
throw new SwatException(
"Property 'email_widget' is null. " .
'Expected a reference to a SwatEmailE... | php | public function process()
{
parent::process();
if ($this->value === null) {
return;
}
if ($this->email_widget === null) {
throw new SwatException(
"Property 'email_widget' is null. " .
'Expected a reference to a SwatEmailE... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"email_widget",
"===",
"null",
")",
"{",
"... | Checks to make sure email addresses match
Checks to make sure the values of the two email address fields are the
same. If an associated email entry widget is not set, an exception is
thrown. If the addresses do not match, an error is added to this widget.
@throws SwatException | [
"Checks",
"to",
"make",
"sure",
"email",
"addresses",
"match"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatConfirmEmailEntry.php#L36-L61 |
33,999 | silverorange/swat | Swat/SwatImageCropper.php | SwatImageCropper.display | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$this->autoCropBoxDimensions();
$div_tag = new SwatHtmlTag('div');
$div_tag->id = $this->id;
$div_tag->class = 'swat-image-cropper yui-skin-sam';
$div_tag->o... | php | public function display()
{
if (!$this->visible) {
return;
}
parent::display();
$this->autoCropBoxDimensions();
$div_tag = new SwatHtmlTag('div');
$div_tag->id = $this->id;
$div_tag->class = 'swat-image-cropper yui-skin-sam';
$div_tag->o... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"display",
"(",
")",
";",
"$",
"this",
"->",
"autoCropBoxDimensions",
"(",
")",
";",
"$",
"div_tag",
"=",
"n... | Displays this image cropper | [
"Displays",
"this",
"image",
"cropper"
] | e65dc5bc351927c61f594068430cdeeb874c8bc5 | https://github.com/silverorange/swat/blob/e65dc5bc351927c61f594068430cdeeb874c8bc5/Swat/SwatImageCropper.php#L181-L230 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.