function renderLevel($depth) { /* * Build the CSS class suffix */ $class = ''; if ($this->_current->hasChildren()) { $class = ' class="node"'; } if ($this->_current->class == 'separator') { $class = ' class="separator"'; } if ($this->_current->class == 'disabled') { $class = ' class="disabled"'; } /* * Print the item */ echo "<li" . $class . ">"; /* * Print a link if it exists */ $linkClass = ''; if ($this->_current->link != null) { $linkClass = $this->getIconClass($this->_current->class); if (!empty($linkClass)) { $linkClass = ' class="' . $linkClass . '"'; } } if ($this->_current->link != null && $this->_current->target != null) { echo "<a" . $linkClass . " href=\"" . $this->_current->link . "\" target=\"" . $this->_current->target . "\" >" . $this->_current->title . "</a>"; } elseif ($this->_current->link != null && $this->_current->target == null) { echo "<a" . $linkClass . " href=\"" . $this->_current->link . "\">" . $this->_current->title . "</a>"; } elseif ($this->_current->title != null) { echo "<a>" . $this->_current->title . "</a>\n"; } else { echo "<span></span>"; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { if ($this->_current->class) { $id = ''; if (!empty($this->_current->id)) { $id = ' id="menu-' . strtolower($this->_current->id) . '"'; } echo '<ul' . $id . ' class="menu-component">' . "\n"; } else { echo '<ul>' . "\n"; } foreach ($this->_current->getChildren() as $child) { $this->_current =& $child; $this->renderLevel($depth++); } echo "</ul>\n"; } echo "</li>\n"; }
/** * Recursively dives through a category to fetch its children ( Used for J! 1.6) * * @access public * @param object $category category object whose children are to be fetched * @param int $level level of indention to start from * @return string indented category tree */ function fetchChildren($category, $level) { $output = ''; foreach ($category->getChildren() as $child) { $child->setTitle(str_repeat("...", $level) . $child->getTitle); $output .= JHTML::_('jwf.indentedLine', $child->getId() . " : '{$child->getTitle()}',", 5); if (count($child->getChildren())) { $output .= $this->fetchChildren($child, $level + 1); } } return $output; }
/** * @param object $block * * @return DateTime */ public static function recursiveBlockUpdateDate($block) { if (!$block instanceof BlockInterface) { return null; } $modified = $block->getUpdatedAt(); if ($block instanceof ContainerBlock) { /* @var $block ContainerBlock */ foreach ($block->getChildren() as $childBlock) { $modified = max($modified, self::recursiveBlockUpdateDate($childBlock)); } } elseif ($block instanceof ReferenceBlock) { /* @var $block ReferenceBlock */ $modified = max($modified, self::recursiveBlockUpdateDate($block->getReferencedBlock())); } return $modified; }
/** * Updates UrlInformation with new values if they are not already set. * * @param UrlInformation $urlInformation The value object to update. * @param object $object The sitemap element to get values from. * @param string $sitemap Name of the sitemap being built. */ public function guessValues(UrlInformation $urlInformation, $object, $sitemap) { if ($urlInformation->getLastModification()) { return; } if ($object instanceof OnePageContent) { /* @var $object OnePageContent */ $updated = $object->getUpdatedAt(); foreach ($object->getChildren(true) as $section) { /* @var $section OnePageSection */ $updated = max($updated, $this->sectionUpdateDate($section)); } $urlInformation->setLastModification($updated); } elseif ($object instanceof OnePageSection) { /* @var $object OnePageSection */ $urlInformation->setLastModification($this->sectionUpdateDate($object)); } }
public function renderLevel($depth) { /* * Build the CSS class suffix */ $class = ''; if ($this->_current->hasChildren()) { $class = ' class="dropdown"'; } if ($this->_current->class == 'separator') { $class = ' class="divider"'; } if ($this->_current->hasChildren() && $this->_current->class) { $class = ' class="dropdown-submenu"'; } if ($this->_current->class == 'disabled') { $class = ' class="disabled"'; } /* * Print the item */ echo "<li" . $class . ">"; /* * Print a link if it exists */ $linkClass = ''; $dataToggle = ''; $dropdownCaret = ''; if ($this->_current->hasChildren()) { $linkClass = ' class="dropdown-toggle"'; $dataToggle = ' data-toggle="dropdown"'; if (!$this->_current->getParent()->hasParent()) { $dropdownCaret = ' <span class="caret"></span>'; } } if ($this->_current->link != null && $this->_current->target != null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\" target=\"" . $this->_current->target . "\" >" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->link != null && $this->_current->target == null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\">" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->title != null) { echo "<a" . $linkClass . " " . $dataToggle . ">" . $this->_current->title . $dropdownCaret . "</a>"; } else { echo "<span></span>"; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { if ($this->_current->class) { $id = ''; if (!empty($this->_current->id)) { $id = ' id="menu-' . strtolower($this->_current->id) . '"'; } echo '<ul' . $id . ' class="dropdown-menu menu-component">' . "\n"; } else { echo '<ul class="dropdown-menu">' . "\n"; } foreach ($this->_current->getChildren() as $child) { $this->_current =& $child; $this->renderLevel($depth++); } echo "</ul>\n"; } echo "</li>\n"; }
/** * Method to render a given level of a menu * * @param integer $depth The level of the menu to be rendered * * @return void */ public function renderLevel($depth) { // Build the CSS class suffix $class = ''; if ($this->_current->hasChildren()) { $class = ' class="dropdown"'; } if ($this->_current->class == 'separator') { $class = ' class="divider"'; } if ($this->_current->hasChildren() && $this->_current->class) { $class = ' class="dropdown-submenu"'; } if (SCAdminCSSMenu::_isActive($this->_current->title)) { $class .= ' class="active"'; } if (SCAdminCSSMenu::_isActive($this->_current->title) && $this->_current->hasChildren()) { $class = ' class="active dropdown"'; } if ($this->_current->class == 'disabled') { $class = ' class="disabled"'; } // Print the item echo "<li" . $class . ">"; // Print a link if it exists $linkClass = array(); $dataToggle = ''; $dropdownCaret = ''; if ($this->_current->hasChildren()) { $linkClass[] = 'dropdown-toggle'; $dataToggle = ' data-toggle="dropdown"'; if (!$this->_current->getParent()->hasParent()) { $dropdownCaret = ' <span class="caret"></span>'; } } if ($this->_current->link != null && $this->_current->getParent()->title != 'ROOT') { $iconClass = $this->getIconClass($this->_current->class); if (!empty($iconClass)) { $linkClass[] = $iconClass; } } // Implode out $linkClass for rendering $linkClass = ' class="' . implode(' ', $linkClass) . '"'; if ($this->_current->link != null && $this->_current->target != null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\" target=\"" . $this->_current->target . "\" >" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->link != null && $this->_current->target == null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\">" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->title != null) { echo "<a" . $linkClass . " " . $dataToggle . ">" . $this->_current->title . $dropdownCaret . "</a>"; } else { echo "<span></span>"; } // Recurse through children if they exist while ($this->_current->hasChildren()) { if ($this->_current->class) { $id = ''; if (!empty($this->_current->id)) { $id = ' id="menu-' . strtolower($this->_current->id) . '"'; } echo '<ul' . $id . ' class="dropdown-menu menu-component">' . "\n"; } else { echo '<ul class="dropdown-menu">' . "\n"; } foreach ($this->_current->getChildren() as $child) { $this->_current =& $child; $this->renderLevel($depth++); } echo "</ul>\n"; } echo "</li>\n"; }
/** * extractKeyValuePairs recursively walks through all PDFformfield objects * and their children to extract key/value pairs from them * * @param object $field - the field object to get keys and values from * * @return N/A - operates directly on the $this->keyValues property */ protected function extractKeyValuePairs($field) { if ($this->debugLevel > self::DEBUG_HIDE_EXTRACTION) { echo "Entered extractKeyValuePairs<br />\n"; } if (++$this->iterations > self::MAX_ITERATIONS) { //Recursion failsafe throw new PDFexception('Key/Value Overflow Error'); } $fieldType = $field->getFieldType(); if ($fieldType == 'Btn' || $fieldType == 'Sig') { return; //We don't care about buttons or signature fields } $this->keyValues[] = $field->getKeyValue(); //If this field has kids, do it all again if ($field->hasChildren()) { $children = $field->getChildren(); foreach ($children as $child) { $this->extractKeyValuePairs($child); } } return; }
/** * Считает инфу по количеству постов и топиков в подфорумах * * @param object $oForum * @return object */ public function CalcChildren($oForum, $bPerm = 1, $bNoModer = 1, $bMark = 0) { if ($bMark) { $aMark = $this->GetMarking(); $sUserMark = isset($aMark[self::MARKER_USER]) ? $aMark[self::MARKER_USER] : null; $sMarkDate = isset($aMark[self::MARKER_FORUM][$oForum->getId()]) ? $aMark[self::MARKER_FORUM][$oForum->getId()] : $sUserMark; if ($sMarkDate && strtotime($sMarkDate) >= strtotime($oForum->getLastPostDate())) { $oForum->setRead(true); } } $aChildren = $oForum->getChildren(); if (!empty($aChildren)) { foreach ($aChildren as $oChildren) { $oChildren = $this->CalcChildren($oChildren, $bPerm, $bNoModer, $bMark); if (!$oChildren->getRead()) { $oForum->setRead(false); } if ($oChildren->getLastPostId() > $oForum->getLastPostId()) { $oForum->setLastPostId($oChildren->getLastPostId()); } $oForum->setCountTopic($oForum->getCountTopic() + $oChildren->getCountTopic()); $oForum->setCountPost($oForum->getCountPost() + $oChildren->getCountPost()); } } return $bPerm ? $this->BuildPerms($oForum, $bNoModer) : $oForum; }
/** * Reads all test files from base directory and subdirecotries * * @param array $testcaseFilenames array to store found testcases * @param object $testsDirectoryIterator RecursiveDirectoryIterator object * @return array Filenames of all found testcase files * @author Ronny Unger <*****@*****.**> */ protected function readDirectories(array $testcaseFilenames, $testsDirectoryIterator) { while ($testsDirectoryIterator->valid()) { if ($testsDirectoryIterator->hasChildren() && $testsDirectoryIterator->getFilename() != '.svn') { $testcaseFilenames = $this->readDirectories($testcaseFilenames, $testsDirectoryIterator->getChildren()); } if (!$testsDirectoryIterator->isDir()) { $pathAndFilename = \F3\FLOW3\Utility\Files::getUnixStylePath($testsDirectoryIterator->getPathname()); if (preg_match('/\\/' . str_replace('\\', '\\/', $this->testcaseClassName) . '\\.php/', $pathAndFilename) === 1) { $testcaseFilenames[] = $pathAndFilename; } } $testsDirectoryIterator->next(); } return $testcaseFilenames; }