/** * Retrieves the HTML string. * * @return string */ public function toHtml() { if ($this->hided) { $this->style .= 'display: none;'; } $html = sprintf('<ul %s>', $this->getAttributes(['id', 'class', 'style'])) . PHP_EOL; foreach ($this->values as $key => $value) { $itemNameClass = 'name'; if (is_array($value)) { $itemNameClass .= ' closed'; $accordion = new Accordion(); $accordion->id = $this->id . '-' . $key; $accordion->values = $value; $accordion->hided = true; $content = $accordion->toHtml(); } else { $content = '<div class="content">' . PHP_EOL; $content .= $value . PHP_EOL; $content .= '</div>' . PHP_EOL; } $html .= '<li>' . PHP_EOL; $html .= sprintf('<div class="%s"', $itemNameClass); $html .= ' onclick="neat.accordion.toggle(this);">' . PHP_EOL; $html .= $key . PHP_EOL; $html .= '</div>' . PHP_EOL; $html .= $content . PHP_EOL; $html .= '</li>' . PHP_EOL; } $html .= '</ul>' . PHP_EOL; return $html; }
public static function buildMany($accordionConfigurations) { $string = ''; foreach ($accordionConfigurations as $config) { $string .= Accordion::build($config); } return $string; }
<?php $page->createTitle(); print $page->getHeader(); print "<div class=\"row pane\">\n"; print " <div class=\"col-xs-12\">\n"; $MIDs = strgetcsv($page->getData()); if ($MIDs !== false) { include_once "lib/modules/meet.php"; include_once "lib/plugins/accordion.php"; $meet = new Meet($mySQL, $page->getPageNumber()); $accordion = new Accordion(); foreach ($MIDs as $meetID) { $meet->setID($meetID); $meet->createMeet(); $sessions = $meet->getMeet(); for ($s = 1; $s <= $meet->getNumberSessions(); $s++) { $content = "Warm Up: " . $meet->getTimes($s, "warm") . "<br />\n"; $content .= "Sign In Closes: " . $meet->getTimes($s, "sign") . "<br />\n"; $content .= "Start: " . $meet->getTimes($s, "start") . "<br />\n"; if ($meet->getDispEvts() === true) { $content .= "<ul>\n"; foreach ($sessions["S{$s}"]["E"] as $event) { if ($event['n'] != 0) { $content .= "<li>" . $meet->eventTitleGED($event) . "</li>\n"; } else { $content .= "<li>" . $meet->eventTitle($event) . "</li>\n"; } } $content .= "</ul>\n"; }
/** * Accordion getter Function * @see skip_accordion() * @ignore */ function get_accordion($elements, $args = array(), $return = 'html') { $accordion = new Accordion($args); if (count($elements) > 0) { foreach ($elements as $element) { $accordion->add_element($element['title'], $element['content'], array_key_exists('args', $element) ? $element['args'] : array()); } } else { return FALSE; } return element_return($accordion, $return); }
//$_GET['file'] = 'Scenarios_APR(0.75)_VMs(10,12,14,16,18,20)_PMs(4).json'; if (isset($_GET['state'])) { $scenario = Scenario::getScenarioFromJSON($_GET['state']); } elseif (isset($_GET['file']) && file_exists('others/' . $_GET['file'])) { $scenario = array_pop(json_decode(file('others/' . $_GET['file'])[0], true)); } else { $scenarios = Scenario::geraScenarios($apr, array($nvm), array($npm)); $scenario = array_pop($scenarios); } $json = Scenario::toDataTableJSON($scenario); //$memcache = memcache_connect('localhost', 11211); //$accordion = isset($_GET['cache']) ? false : memcache_get($memcache, 'accordion'); //$accordion = false; //if ($accordion == false) { //echo "<script>alert('Not Cached');</script>"; $accordion = new Accordion(); $sem = Approximation::calcularSemRegras($scenario); $com = Approximation::calcularComRegras($scenario); $last = Approximation::calcularComRegrasMaxVMSub($scenario, $max); $tree = Approximation::treeSearchApproach($scenario, $max); $test1 = 0; //Approximation::calcularComRegrasMaxVMOutIn($scenario, $max); $test_c_a = 0; //Approximation::calculateAvgCombSplitterApproach($scenario, $max); $test_c_s = 0; //Approximation::calculateSumCombSplitterApproach($scenario, $max); $test_s_p = 0; //Approximation::calculateProdSequencialSplitterApproach($scenario, $max); $test_s_s = 0; //Approximation::calculateSumSequencialSplitterApproach($scenario, $max); //$filtered = Combinations::GenerateAllCombinationsMaxVM($scenario['placements'], $max);