protected function setCommonOptions($htmlOptions = false) { if ($this->options && is_array($this->options)) { if (isset($this->options['debug']) && $this->options['debug'] != 'false') { $this->debug = true; } $this->isFromShortCode = isset($this->options['fromshortcode']) && $this->options['fromshortcode'] === true; if (!isset($this->options['unbuffered'])) { $this->options['unbuffered'] = $this->isFromShortCode ? 'false' : 'true'; } if (isset($this->options['showColumns'])) { $this->showColumns = $this->options['showColumns']; } else { if (isset($this->options['show'])) { $this->showColumns = preg_split('/,/', $this->options['show'], -1, PREG_SPLIT_NO_EMPTY); } } if (isset($this->options['hideColumns'])) { $this->hideColumns = $this->options['hideColumns']; } else { if (isset($this->options['hide'])) { $this->hideColumns = preg_split('/,/', $this->options['hide'], -1, PREG_SPLIT_NO_EMPTY); } } if ($htmlOptions) { if (isset($this->options['class'])) { $this->htmlTableClass = $this->options['class']; } else { $this->htmlTableClass = $this->defaultTableClass; } if (isset($this->options['id'])) { $this->htmlTableId = $this->options['id']; } else { $this->htmlTableId = 'cftble_' . rand(); } if (isset($this->options['style'])) { $this->style = $this->options['style']; } } if (isset($this->options['filter'])) { require_once 'CF7FilterParser.php'; require_once 'DereferenceShortcodeVars.php'; $this->rowFilter = new CF7FilterParser(); $this->rowFilter->setComparisonValuePreprocessor(new DereferenceShortcodeVars()); $this->rowFilter->parseFilterString($this->options['filter']); if ($this->debug) { echo '<pre>\'' . $this->options['filter'] . "'\n"; print_r($this->rowFilter->tree); echo '</pre>'; } } else { if (isset($this->options['search'])) { require_once 'CF7SearchEvaluator.php'; $this->rowFilter = new CF7SearchEvaluator(); $this->rowFilter->setSearch($this->options['search']); } } } }