Ejemplo n.º 1
0
 public function generate_property_types()
 {
     $tpl = 'internal_property_types';
     $this->property_types = wpl_property_types::get_property_types();
     /** import tpl **/
     parent::render($this->tpl_path, $tpl);
 }
Ejemplo n.º 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);
         }
     }
 }
 private function can_remove_property_type()
 {
     $property_type_id = wpl_request::getVar('property_type_id');
     $res = wpl_property_types::have_properties($property_type_id);
     $res = (int) $res;
     if ($res > 0) {
         $res = 0;
     } else {
         $res = 1;
     }
     echo $res;
     exit;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
            buttonImageOnly: true
        });
    });
    </script>';
    $done_this = true;
} elseif ($type == 'ptcategory' and !$done_this) {
    switch ($field['type']) {
        case 'select':
            $show = 'select';
            $any = true;
            $label = true;
            break;
    }
    /** current value **/
    $current_value = stripslashes(wpl_request::getVar('sf_ptcategory', -1));
    $categories = wpl_property_types::get_property_type_categories();
    if ($label) {
        $html .= '<label>' . __($field['name'], WPL_TEXTDOMAIN) . '</label>';
    }
    if ($show == 'select') {
        $html .= '<select name="sf' . $widget_id . '_ptcategory" class="wpl_search_widget_field_' . $field['id'] . '" id="sf' . $widget_id . '__ptcategory">';
        if ($any) {
            $html .= '<option value="-1">' . __($field['name'], WPL_TEXTDOMAIN) . '</option>';
        }
        foreach ($categories as $category) {
            $html .= '<option data-id="' . $category['id'] . '" value="' . $category['name'] . '" ' . (strtolower($current_value) == strtolower($category['name']) ? 'selected="selected"' : '') . '>' . __($category['name'], WPL_TEXTDOMAIN) . '</option>';
        }
        $html .= '</select>';
        $html .= '<script type="text/javascript">
        wplj(function()
        {