Example #1
0
 public function home()
 {
     /** check permission **/
     wpl_global::min_access('administrator');
     $this->level = trim(wpl_request::getVar('level')) != '' ? wpl_request::getVar('level') : 1;
     $this->parent = trim(wpl_request::getVar('sf_select_parent')) != '' ? wpl_request::getVar('sf_select_parent') : "";
     $this->enabled = trim(wpl_request::getVar('sf_select_enabled')) != '' ? wpl_request::getVar('sf_select_enabled') : 1;
     $this->text_search = trim(wpl_request::getVar('sf_text_name')) != '' ? wpl_request::getVar('sf_text_name') : '';
     $this->admin_url = wpl_global::get_wp_admin_url();
     $this->load_zipcodes = trim(wpl_request::getVar('load_zipcodes')) != '' ? 1 : 0;
     /** set show all based on level **/
     if ($this->level != 1) {
         $this->enabled = '';
     }
     $possible_orders = array('id', 'name');
     $orderby = in_array(wpl_request::getVar('orderby'), $possible_orders) ? wpl_request::getVar('orderby') : $possible_orders[0];
     $order = in_array(strtoupper(wpl_request::getVar('order')), array('ASC', 'DESC')) ? wpl_request::getVar('order') : 'ASC';
     $page_size = trim(wpl_request::getVar('page_size')) != '' ? wpl_request::getVar('page_size') : NULL;
     /** create where **/
     $vars = array_merge(wpl_request::get('POST'), wpl_request::get('GET'));
     $vars = array_merge($vars, array('sf_select_parent' => $this->parent, 'sf_select_enabled' => $this->enabled));
     $where_query = wpl_db::create_query($vars);
     $num_result = wpl_db::num("SELECT COUNT(id) FROM `#__wpl_location" . $this->level . "` WHERE 1 " . $where_query);
     $this->pagination = wpl_pagination::get_pagination($num_result, $page_size);
     $where_query .= " ORDER BY {$orderby} {$order} " . $this->pagination->limit_query;
     $this->wp_locations = wpl_locations::get_locations(!$this->load_zipcodes ? $this->level : 'zips', '', '', $where_query);
     $this->zipcode_parent_level = wpl_settings::get('zipcode_parent_level');
     /** import tpl **/
     parent::render($this->tpl_path, $this->tpl);
 }
Example #2
0
 /**
  * 
  * @author Howard <*****@*****.**>
  * @param array $links
  * @param string $file
  * @return array
  */
 public static function wpl_plugin_links($links, $file)
 {
     if (strpos($file, WPL_BASENAME) !== false) {
         $links[] = '<a href="' . wpl_global::get_wp_admin_url() . 'admin.php?page=wpl_admin_settings">' . __('Settings', WPL_TEXTDOMAIN) . '</a>';
         $links[] = '<a href="http://wpl.realtyna.com/wassets/wpl-manual.pdf" target="_blank">' . __('WPL Manual', WPL_TEXTDOMAIN) . '</a>';
         $links[] = '<a href="http://wpl.realtyna.com/redirect.php?action=shop" target="_blank">' . __('WPL Add-ons', WPL_TEXTDOMAIN) . '</a>';
     }
     return $links;
 }
Example #3
0
?>
</span>
        </h2>
    </header>

    <div id="dashboard-links-wp">
        <ul>
            <?php 
foreach ($this->submenus as $submenu) {
    ?>
                <li class="link-<?php 
    echo $submenu->id;
    ?>
">
                    <a href="<?php 
    echo wpl_global::get_wp_admin_url();
    ?>
admin.php?page=<?php 
    echo $submenu->menu_slug;
    ?>
">
                        <span class="box"><i></i></span>
                        <span class="title">
                            <?php 
    echo __($submenu->menu_title, WPL_TEXTDOMAIN);
    ?>
                        </span>
                    </a>
                </li>
            <?php 
}