/** * livesearchAction * @author Thomas Schedler <*****@*****.**> */ public function livesearchAction() { $this->_helper->viewRenderer->setNoRender(); require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Tags.php'; $objModelTags = new Model_Tags(); $objAllTags = $objModelTags->loadAllTags(); $strAllTags = '['; if (count($objAllTags) > 0) { foreach ($objAllTags as $objTag) { $strAllTags .= '{"caption":"' . htmlentities($objTag->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '","value":' . $objTag->id . '},'; } $strAllTags = trim($strAllTags, ','); } $strAllTags .= ']'; echo $strAllTags; }
/** * buildTags * @author Thomas Schedler <*****@*****.**> * @version 1.1 */ public function buildTags() { $element = $this->getElement(); $helper = $element->helper; require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Tags.php'; $objModelTags = new Model_Tags(); $objAllTags = $objModelTags->loadAllTags(); $output = $element->getView()->{$helper}($element->getName(), $element->getValue(), $element->getAttribs(), $element->options, $element->regionId, $objAllTags, $element->tagIds); return $output; }
/** * getAllTagsForAutocompleter * @param string $strElementId * @return string $strAllTags * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getAllTagsForAutocompleter($strElementId) { require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Tags.php'; $objModelTags = new Model_Tags(); $objAllTags = $objModelTags->loadAllTags(); $strAllTags = ''; if (count($objAllTags) > 0) { $strAllTags .= 'var ' . $strElementId . '_json = ['; foreach ($objAllTags as $objTag) { $strAllTags .= '{"caption":"' . htmlentities($objTag->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '","value":' . $objTag->id . '},'; } $strAllTags = trim($strAllTags, ','); $strAllTags .= '];'; $strAllTags .= $strElementId . '_json.each(function(t){' . $strElementId . '_list.autoFeed(t)})'; } return $strAllTags; }