/** * @abstract Gets the a specified list. Requires at least one (1) listID. * * @return The list as indicated by the provided listID. If more than one (1) listID is provided, * an associative array will be returned with listID's as indexes. */ public static function build() { $listIDs = func_get_args(); $c = count($listIDs); $lists = array(); // No id's specified if ($c == 0) { return array(false); } // Get the list for each ID provided foreach ($listIDs as $listID) { $lists[$listID] = ListBuilder::handle($listID, HANDLE_GET); } // If only 1 ID was provided, return just that list; otherwise, return an array of lists. return $c == 1 ? $lists[$listIDs[0]] : $lists; }
/** * @abstract Builds the Javascript include markup. * * @return string The Javascript include markup as included through WebPage::javascriptInclude() * and formatted using WebPage::TMPL_INC_JAVASCRIPT. * * @see WebPage::javascriptInclude(); * @see WebPage::TMPL_INC_JAVASCRIPT */ public static function javascriptList() { $includes = ListBuilder::build('js-inc'); $response = ''; if (is_array($includes)) { foreach ($includes as $include) { $response .= sprintf(WebPage::TMPL_INC_JAVASCRIPT, $include); } } return $response; }
/** * (non-PHPdoc). * * @see \Admingenerator\GeneratorBundle\Builder\BaseBuilder::getTemplatesToGenerate() */ public function getTemplatesToGenerate() { return parent::getTemplatesToGenerate() + array('ListBuilderTemplate' . self::TWIG_EXTENSION => 'Resources/views/' . $this->getBaseGeneratorName() . 'List/index.html.twig', 'List/FiltersBuilderTemplate' . self::TWIG_EXTENSION => 'Resources/views/' . $this->getBaseGeneratorName() . 'List/filters.html.twig', 'List/ResultsBuilderTemplate' . self::TWIG_EXTENSION => 'Resources/views/' . $this->getBaseGeneratorName() . 'List/results.html.twig', 'List/RowBuilderTemplate' . self::TWIG_EXTENSION => 'Resources/views/' . $this->getBaseGeneratorName() . 'List/row.html.twig'); }
} ?> <fieldset> <label for="<?php echo $strField; ?> " title="<?php echo $strDescription; ?> ">Placeholder: <?php echo $strName; ?> </label> <div class="field-container"> <?php ListBuilder::render($strField, $aryAvailable, $arySelected); ?> </div> </fieldset> <input type="hidden" name="placeholders[]" value="<?php echo $strName; ?> "> <?php } ?> </div> <input type="hidden" name="node" value="<?php echo $strNode;