示例#1
0
 public function generate_listing_types()
 {
     $tpl = 'internal_listing_types';
     $this->listing_types = wpl_listing_types::get_listing_types();
     $this->listing_gicons = wpl_listing_types::get_map_icons();
     $this->get_caption_imgs = wpl_listing_types::get_caption_images();
     /** import tpl **/
     parent::render($this->tpl_path, $tpl);
 }
示例#2
0
 /**
  * Generates modify form of a dbst field
  * @author Howard R <*****@*****.**>
  * @static
  * @param string $dbst_type
  * @param int $dbst_id
  * @param int $kind
  * @return void
  */
 public static function generate_modify_form($dbst_type = 'text', $dbst_id = 0, $kind = 0)
 {
     /** first validation **/
     if (!$dbst_type) {
         return;
     }
     $dbst_data = $dbst_id != 0 ? self::get_field($dbst_id) : new stdClass();
     $done_this = false;
     $type = $dbst_type;
     $values = $dbst_data;
     $options = isset($values->options) ? json_decode($values->options, true) : array();
     $__prefix = 'wpl_flex_modify';
     _wpl_import('libraries.listing_types');
     _wpl_import('libraries.property_types');
     $dbcats = self::get_categories(0, $kind);
     $listings = wpl_listing_types::get_listing_types();
     $property_types = wpl_property_types::get_property_types();
     $user_types = wpl_users::get_user_types(1, 'loadAssocList');
     $memberships = wpl_users::get_wpl_memberships();
     /** get files **/
     $dbst_modifypath = WPL_ABSPATH . DS . 'libraries' . DS . 'dbst_modify';
     $files = array();
     if (wpl_folder::exists($dbst_modifypath)) {
         $files = wpl_folder::files($dbst_modifypath, '.php$');
         foreach ($files as $file) {
             include $dbst_modifypath . DS . $file;
         }
         if (!$done_this) {
             /** include default file **/
             include _wpl_import('libraries.dbst_modify.main.default', true, true);
         }
     }
 }
示例#3
0
 private function generate_edit_page($user_id = '')
 {
     $this->user_info = wpl_users::get_user($user_id);
     $this->fields = wpl_db::columns('wpl_users');
     $this->user_data = wpl_users::get_wpl_user($user_id);
     $this->data = $this->user_data;
     $this->units = wpl_units::get_units(4);
     $this->listings = wpl_listing_types::get_listing_types();
     $this->property_types = wpl_property_types::get_property_types();
     $this->memberships = wpl_users::get_wpl_memberships();
     $this->membership_types = wpl_users::get_membership_types();
     parent::render($this->tpl_path, 'edit');
     exit;
 }
 private function can_remove_listing_type()
 {
     $listing_type_id = wpl_request::getVar('listing_type_id');
     $res = wpl_listing_types::have_properties($listing_type_id);
     $res = (int) $res;
     if ($res > 0) {
         $res = 0;
     } else {
         $res = 1;
     }
     echo $res;
     exit;
 }