public function generate_sort_options() { $tpl = 'internal_sort_options'; $this->sort_options = wpl_sort_options::get_sort_options('0', 0); /** import tpl **/ parent::render($this->tpl_path, $tpl); }
private function sort_options($sort_ids) { if (trim($sort_ids) == '') { $sort_ids = wpl_request::getVar('sort_ids'); } wpl_sort_options::sort_options($sort_ids); exit; }
();" /> <label for="<?php echo $this->get_field_id('data_random'); ?> "><?php echo __('Random', WPL_TEXTDOMAIN); ?> : </label> </div> <h4><?php echo __('Sort and Limit'); ?> </h4> <?php $sort_options = wpl_sort_options::get_sort_options(2); ?> <div> <label for="<?php echo $this->get_field_id('data_orderby'); ?> "><?php echo __('Order by', WPL_TEXTDOMAIN); ?> : </label> <select id="<?php echo $this->get_field_id('data_orderby'); ?> " name="<?php echo $this->get_field_name('data'); ?>
<?php } ?> <span class="ajax-inline-save" id="wpl_ajax_loader_<?php echo $setting_record->id; ?> "></span> </div> </div> <?php $done_this = true; } elseif ($type == 'sort_option' and !$done_this) { $kind = trim($options['kind']) != '' ? $options['kind'] : 1; _wpl_import('libraries.sort_options'); $sort_options = wpl_sort_options::get_sort_options($options['kind'], 1); /** getting enaled sort options **/ ?> <div class="prow wpl_setting_form_container wpl_st_type<?php echo $setting_record->type; ?> wpl_st_<?php echo $setting_record->setting_name; ?> " id="wpl_st_<?php echo $setting_record->id; ?> "> <div class="select-wp"> <label for="wpl_st_form_element<?php echo $setting_record->id;
<?php /** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); /** include library **/ _wpl_import('libraries.sort_options'); $result = NULL; $type = isset($params['type']) ? $params['type'] : 1; # 1 == ul and 0 == selectbox $return_array = isset($params['return_array']) ? $params['return_array'] : 0; $rss = isset($params['rss']) ? $params['rss'] : 1; $save_search = isset($params['save_search']) ? $params['save_search'] : 0; $sort_options = wpl_sort_options::get_sort_options(0, 1); $result_array = array(); foreach ($sort_options as $sort_option) { $result_array['sort_options'][] = array('field_name' => $sort_option['field_name'], 'url' => '', 'active' => $this->orderby == $sort_option['field_name'] ? 1 : 0, 'order' => ($this->order == 'DESC' and $this->orderby == $sort_option['field_name']) ? 'ASC' : 'DESC', 'name' => $sort_option['name']); } $html = ''; if ($type == 0) { $html .= '<select class="wpl_plist_sort" onchange="wpl_page_sortchange(this.value);">'; foreach ($sort_options as $sort_option) { $html .= '<option value="wplorderby=' . urlencode($sort_option['field_name']) . '&wplorder=ASC" ' . (($this->orderby == $sort_option['field_name'] and $this->order == 'ASC') ? 'selected="selected"' : '') . '>' . __($sort_option['name'], WPL_TEXTDOMAIN) . ' ' . __('Ascending', WPL_TEXTDOMAIN) . '</option>'; $html .= '<option value="wplorderby=' . urlencode($sort_option['field_name']) . '&wplorder=DESC" ' . (($this->orderby == $sort_option['field_name'] and $this->order == 'DESC') ? 'selected="selected"' : '') . '>' . __($sort_option['name'], WPL_TEXTDOMAIN) . ' ' . __('Descending', WPL_TEXTDOMAIN) . '</option>'; } $html .= '</select>'; } elseif ($type == 1) { $html .= '<ul>'; $sort_type = ''; foreach ($sort_options as $sort_option) { $class = "wpl_plist_sort"; if ($this->orderby == $sort_option['field_name']) {