/** * Prepares the data to be passed to javascript * * @return array * */ private function prepareJsData() { $main = meAnjanWqg_Main::getInstance(); $jsData = array('idPrefix' => $main->getConfig('idPrefix'), 'ajax_url' => array('form_generate' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_GENERATE_CODE), 'author_id_autocomplete' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_AUTHOR_ID_AUTOCOMLETE), 'author_name_autocomplete' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_AUTHOR_NAME_AUTOCOMLETE), 'taxonomy_terms' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_TAXONOMY_TERMS), 'data_preview' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_DATA_PREVIEW), 'post_list' => meAnjanWqg_Utils::wpAjaxUrl(self::AJAX_ACTION_POST_LIST)), 'codeMirrorTheme' => self::CODEMIRROR_THEME, 'html_ids' => $main->getConfig('html/ids'), 'taxonomies' => meAnjanWqg_Taxonomies::getTaxonomies(), 'taxonomy_fields' => array(array('label' => 'ID', 'value' => 'term_id', 'default' => 1), array('label' => 'Name', 'value' => 'name', 'default' => 0), array('label' => 'Slug', 'value' => 'slug', 'default' => 0)), 'taxonomy_operators' => array(array('value' => 'IN', 'default' => 1, 'label' => 'Match Any'), array('value' => 'NOT IN', 'default' => 0, 'label' => 'Match None'), array('value' => 'AND', 'default' => 0, 'label' => 'Match All'), array('value' => 'EXISTS', 'default' => 0, 'label' => 'Exists'), array('value' => 'NOT EXISTS', 'default' => 0, 'label' => 'Not Exists'))); return $jsData; }
</select> </label> </td> </tr> <tr> <td> <div class="me-anjan-wqg-tax-query-block"></div> <div style="clear: both;"></div> <input type="button" id="me-anjan-wqg-add-taxonomy" value="Add Taxonomy" class="button" /> </td> </tr> <tr> <td> <?php $res = meAnjanWqg_Taxonomies::getTaxonomies(); ?> </td> </tr> </table> <script type="text/javascript"> var meAnjanPluginsWqgTaxRules = <?php echo json_encode(meAnjanWqg_Utils::arrayValue($wqgData, 'tax/rules')); ?> ; </script>