Exemplo n.º 1
0
         $any = false;
         $label = true;
         break;
     case 'radios':
         $show = 'radios';
         $any = false;
         $label = true;
         break;
     case 'radios_any':
         $show = 'radios';
         $any = true;
         $label = true;
         break;
 }
 /** current value **/
 $raw_options = $type == 'user_type' ? wpl_users::get_user_types(1) : wpl_users::get_wpl_memberships();
 $options = array();
 foreach ($raw_options as $raw_option) {
     $options[$raw_option->id] = array('key' => $raw_option->id, 'value' => isset($raw_option->membership_name) ? $raw_option->membership_name : $raw_option->name);
 }
 $current_value = wpl_request::getVar('sf_select_' . $field_data['table_column'], '');
 if ($label) {
     $html .= '<label>' . __($field['name'], WPL_TEXTDOMAIN) . '</label>';
 }
 if ($show == 'select') {
     $html .= '<select name="sf' . $widget_id . '_select_' . $field_data['table_column'] . '" class="wpl_search_widget_field_' . $field['id'] . '" id="sf' . $widget_id . '_select_' . $field_data['table_column'] . '">';
     if ($any) {
         $html .= '<option value="">' . __($field['name'], WPL_TEXTDOMAIN) . '</option>';
     }
     foreach ($options as $option) {
         $html .= '<option value="' . $option['key'] . '" ' . ($current_value == $option['key'] ? 'selected="selected"' : '') . '>' . __($option['value'], WPL_TEXTDOMAIN) . '</option>';
Exemplo 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);
         }
     }
 }
Exemplo n.º 3
0
				<option value="<?php 
    echo $wpl_user->ID;
    ?>
"><?php 
    echo $wpl_user->user_login . ((trim($wpl_user->first_name) != '' or trim($wpl_user->last_name) != '') ? ' (' . $wpl_user->first_name . ' ' . $wpl_user->last_name . ')' : '');
    ?>
</option>
                <?php 
}
?>
            </select>
        </div>
        
        <div class="plugin-row wpl_shortcode_parameter wpl_hidden_element pr_profile_listing">
            <?php 
$user_types = wpl_users::get_user_types();
?>
            <label for="pr_user_type_selectbox"><?php 
echo __('User Type', WPL_TEXTDOMAIN);
?>
</label>
            <select id="pr_user_type_selectbox" name="sf_select_membership_type">
                <option value="">-----</option>
                <?php 
foreach ($user_types as $user_type) {
    ?>
				<option value="<?php 
    echo $user_type->id;
    ?>
"><?php 
    echo __($user_type->name, WPL_TEXTDOMAIN);