Пример #1
0
/**
 * Set Value
 *
 * We have removed the part using form validation.
 *
 * @access	public
 * @param	string
 * @return	mixed
 */
function set_value($field = '', $default = '')
{
    if (!isset($_POST[$field])) {
        return $default;
    }
    return form_prep($_POST[$field], $field);
}
Пример #2
0
 /**
  * Display Low Variables field
  *
  * @param mixed $data the variable data
  *
  * @return string    the field's display
  */
 public function display_input($var_id, $var_data, $var_settings)
 {
     // Local cache
     static $loaded;
     // Load the RTE lib
     ee()->load->add_package_path(PATH_MOD . 'rte');
     ee()->load->library('rte_lib');
     //add the RTE js if it hasn't already been added
     if ($loaded !== TRUE) {
         // Load JS lib
         ee()->load->library('javascript');
         // Add RTE JS to CP
         ee()->javascript->output(ee()->rte_lib->build_js(0, '.WysiHat-field', NULL, TRUE));
         // Add FileManager JS to CP
         ee()->load->library(array('filemanager', 'file_field'));
         ee()->file_field->browser();
         $loaded = TRUE;
     }
     // Translate settings
     $settings = array('field_ta_rows' => $this->get_setting('rows', $var_settings), 'field_text_direction' => $this->get_setting('text_direction', $var_settings), 'field_fmt' => 'xhtml');
     $field_id = 'var_' . $var_id;
     //do this once to properly prep the data,
     //otherwise HTML special chars get wrongly converted
     $var_data = form_prep($var_data, $field_id);
     //use the channel field display_field method
     $field = ee()->rte_lib->display_field($var_data, $field_id, $settings);
     return preg_replace('/name="var_(\\d+)"/i', 'name="var[$1]"', $field);
 }
Пример #3
0
 function _parse_form_attributes_ex($attributes, $default)
 {
     if (is_array($attributes)) {
         foreach ($default as $key => $val) {
             if (isset($attributes[$key])) {
                 $default[$key] = $attributes[$key];
                 unset($attributes[$key]);
             }
         }
         if (count($attributes) > 0) {
             $default = array_merge($default, $attributes);
         }
     }
     $att = '';
     foreach ($default as $key => $val) {
         if ($key == 'value') {
             $val = form_prep($val, $default['name']);
         }
         if (strpos($val, '"') >= 0) {
             $att .= $key . '=\'' . $val . '\' ';
         } else {
             $att .= $key . '="' . $val . '" ';
         }
     }
     return $att;
 }
Пример #4
0
 /**
  * Display Low Variables field
  *
  * @param mixed $data the variable data
  *
  * @return string    the field's display
  */
 public function display_input($var_id, $var_data, $var_settings)
 {
     // Only supported in 2.5.3+
     if (version_compare(APP_VER, '2.5.3') < 0) {
         return '<em>The RTE for Low Variables requires ExpressionEngine 2.5.3+</em>';
     }
     // Local cache
     static $loaded;
     // Load the RTE lib
     $this->EE->load->add_package_path(PATH_MOD . 'rte');
     $this->EE->load->library('rte_lib');
     //add the RTE js if it hasn't already been added
     if ($loaded !== TRUE) {
         // Load JS lib
         $this->EE->load->library('javascript');
         // Add RTE JS to CP
         $this->EE->javascript->output($this->EE->rte_lib->build_js(0, '.WysiHat-field', NULL, TRUE));
         // Add FileManager JS to CP
         $this->EE->load->library(array('filemanager', 'file_field'));
         $this->EE->file_field->browser();
         $loaded = TRUE;
     }
     // Translate settings
     $settings = array('field_ta_rows' => $this->get_setting('rows', $var_settings), 'field_text_direction' => $this->get_setting('text_direction', $var_settings), 'field_fmt' => 'none');
     $field_id = 'var_' . $var_id;
     //do this once to properly prep the data,
     //otherwise HTML special chars get wrongly converted
     form_prep($var_data, $field_id);
     //use the channel field display_field method
     $field = $this->EE->rte_lib->display_field($var_data, $field_id, $settings);
     return preg_replace('/name="var_(\\d+)"/i', 'name="var[$1]"', $field);
 }
 /**
  * ----------------------------------------------------------
  * Set Value: Get the value from a form
  * Extends method to return posted data for fields with no rules
  * ----------------------------------------------------------
  * 
  * @param string $field
  * @param string $default
  * @return string
  */
 function set_value($field = '', $default = '')
 {
     // no post?
     if (count($_POST) == 0) {
         return $default;
     }
     // no rules for this field?
     if (!isset($this->_field_data[$field])) {
         $this->set_rules($field, '', '');
         // fieldname is an array
         if ($this->_field_data[$field]['is_array']) {
             $keys = $this->_field_data[$field]['keys'];
             $value = $this->_traverse_array($_POST, $keys);
         } else {
             $value = isset($_POST[$field]) ? $_POST[$field] : FALSE;
         }
         // field was not in the post
         if ($value === FALSE) {
             return $default;
         } else {
             $this->_field_data[$field]['postdata'] = form_prep($value, $field);
         }
     }
     return parent::set_value($field, $default);
 }
Пример #6
0
 /**
  * Main login form
  *
  * @access	public
  * @return	void
  */
 public function index()
 {
     // We don't want to allow access to the login screen to someone
     // who is already logged in.
     if ($this->session->userdata('member_id') !== 0 && ee()->session->userdata('admin_sess') == 1) {
         return $this->functions->redirect(BASE);
     }
     // If an ajax request ends up here the user is probably logged out
     if (AJAX_REQUEST) {
         //header('X-EERedirect: C=login');
         header('X-EE-Broadcast: modal');
         die('Logged out');
     }
     $username = $this->session->flashdata('username');
     $this->view->return_path = '';
     $this->view->focus_field = $username ? 'password' : 'username';
     $this->view->username = $username ? form_prep($username) : '';
     $this->view->message = $this->input->get('auto_expire') ? lang('session_auto_timeout') : $this->session->flashdata('message');
     if ($this->input->get('BK')) {
         $this->view->return_path = base64_encode($this->input->get('BK'));
     } else {
         if ($this->input->get('return')) {
             $this->view->return_path = $this->input->get('return');
         }
     }
     $this->view->cp_page_title = lang('login');
     $this->view->render('account/login');
 }
Пример #7
0
/**
 * Form Prep
 *
 * 特殊文字のエスケープを行わないバージョン
 *
 */
function form_prep($str = '', $field_name = '')
{
    static $prepped_fields = array();
    // if the field name is an array we do this recursively
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            $str[$key] = form_prep($val);
        }
        return $str;
    }
    if ($str === '') {
        return '';
    }
    // we've already prepped a field with this name
    // @todo need to figure out a way to namespace this so
    // that we know the *exact* field and not just one with
    // the same name
    if (isset($prepped_fields[$field_name])) {
        return $str;
    }
    //$str = htmlspecialchars($str);
    // In case htmlspecialchars misses these.
    //$str = str_replace(array("'", '"'), array("&#39;", "&quot;"), $str);
    if ($field_name != '') {
        $prepped_fields[$field_name] = $field_name;
    }
    return $str;
}
Пример #8
0
 /**
  * Main login form
  *
  * @access	public
  * @return	void
  */
 public function index()
 {
     // We don't want to allow access to the login screen to someone
     // who is already logged in.
     if ($this->session->userdata('member_id') !== 0 && ee()->session->userdata('admin_sess') == 1) {
         $member = ee('Model')->get('Member')->filter('member_id', ee()->session->userdata('member_id'))->first();
         return $this->functions->redirect($member->getCPHomepageURL());
     }
     // If an ajax request ends up here the user is probably logged out
     if (AJAX_REQUEST) {
         //header('X-EERedirect: C=login');
         header('X-EE-Broadcast: modal');
         die('Logged out');
     }
     // Are we here after a new install or update?
     $installer_dir = SYSPATH . 'installer_' . ee()->config->item('app_version') . '/';
     if (($type = ee()->input->get('after')) && is_dir($installer_dir)) {
         ee()->lang->load('installer', 'english', FALSE, TRUE, $installer_dir);
         $this->view->message = sprintf(lang("{$type}_success_note"), APP_VER) . BR . sprintf(lang('success_moved'), ee()->config->item('app_version'));
         $this->view->message_status = 'success';
     }
     $username = $this->session->flashdata('username');
     $this->view->return_path = '';
     $this->view->focus_field = $username ? 'password' : 'username';
     $this->view->username = $username ? form_prep($username) : '';
     if (!isset($this->view->message)) {
         $this->view->message = $this->input->get('auto_expire') ? lang('session_auto_timeout') : $this->session->flashdata('message');
     }
     // Normal login button state
     $this->view->btn_class = 'btn';
     $this->view->btn_label = lang('login');
     $this->view->btn_disabled = '';
     // Set lockout message and form state
     if (ee()->session->check_password_lockout($username) === TRUE) {
         $this->view->btn_class .= ' disable';
         $this->view->btn_label = lang('locked');
         $this->view->btn_disabled = 'disabled';
         $this->view->message = sprintf(lang('password_lockout_in_effect'), ee()->config->item('password_lockout_interval'));
     }
     if ($this->view->message != '' && !isset($this->view->message_status)) {
         $this->view->message_status = 'issue';
     }
     // Show the site label
     $site_label = ee('Model')->get('Site')->fields('site_label')->filter('site_id', ee()->config->item('site_id'))->first()->site_label;
     $this->view->header = $site_label ? lang('log_into') . ' ' . $site_label : lang('login');
     if ($this->input->get('BK')) {
         $this->view->return_path = base64_encode($this->input->get('BK'));
     } else {
         if ($this->input->get('return')) {
             $this->view->return_path = $this->input->get('return');
         }
     }
     $this->view->cp_page_title = lang('login');
     $this->view->cp_session_type = ee()->config->item('cp_session_type');
     $this->view->render('account/login');
 }
Пример #9
0
function set_value($field = '', $default = '')
{
    if (!isset($_POST[$field])) {
        return $default;
    }
    if (FALSE === ($OBJ =& _get_validation_object())) {
        return form_prep($_POST[$field], $field);
    }
    return form_prep($OBJ->set_value($field, $_POST[$field]), $field);
}
Пример #10
0
 function set_value($field = '', $default = '')
 {
     $OBJ =& _get_validation_object();
     if ($OBJ === TRUE && isset($OBJ->_field_data[$field])) {
         return form_prep($OBJ->set_value($field, $default));
     } else {
         if (!isset($_POST[$field])) {
             return $default;
         }
         return form_prep($_POST[$field]);
     }
 }
Пример #11
0
/**
 * Set Value
 *
 * We have removed the part using form validation.
 * And added support for POST field arrays.
 *
 * @access	public
 * @param	string
 * @return	mixed
 */
function set_value($field = '', $default = '')
{
    if (stristr($field, '[') !== false) {
        # It uses field arrays, let's work with that.
        $field = explode('[', $field);
        $arrayIndex = str_ireplace(']', '', $field[1]);
        $field = $field[0];
        return isset($_POST[$field][$arrayIndex]) ? form_prep($_POST[$field][$arrayIndex], $field) : $default;
    } else {
        return isset($_POST[$field]) ? form_prep($_POST[$field], $field) : $default;
    }
}
Пример #12
0
 function form_hidden($name, $value = '', $id = false)
 {
     if (!is_array($name)) {
         return '<input type="hidden" id="' . ($id ? $id : $name) . '" name="' . $name . '" value="' . form_prep($value) . '" />';
     }
     $form = '';
     foreach ($name as $name => $value) {
         $form .= "\n";
         $form .= '<input type="hidden"  id="' . ($id ? $id : $name) . '" name="' . $name . '" value="' . form_prep($value) . '" />';
     }
     return $form;
 }
Пример #13
0
 function type2()
 {
     //return data piramida penduduk
     $json_laki = $this->getDataDataUmur('1');
     $json_perempuan = $this->getDataDataUmur('2');
     //$json = json_encode($json_laki+$json_perempuan+$dataPekerjaan);
     $diagram = json_encode($json_laki + $json_perempuan);
     $diagram = str_replace('":', '<=>', $diagram);
     $diagram = str_replace(',"', '","', $diagram);
     $diagram = str_replace('{', '[', $diagram);
     $diagram = str_replace('}', '"]', $diagram);
     $array = array('type' => "2", 'diagram' => form_prep($diagram));
     $json = json_encode($array);
     $json = str_replace('"[', '[', $json);
     $json = str_replace(']"', ']', $json);
     return $json;
 }
Пример #14
0
 function build()
 {
     $output = "";
     switch ($this->status) {
         case "disabled":
         case "show":
             break;
         case "create":
         case "modify":
             $output = '<input type="button" value="' . form_prep($this->label) . '">';
             //ci do not have form helper for buttons
             break;
         case "hidden":
             break;
         default:
     }
     $this->output = "\n" . $output . "\n";
 }
Пример #15
0
 /**
  * Display Cell
  */
 function display_cell($data)
 {
     $this->_prep_settings($this->settings);
     if (!isset($this->cache['displayed'])) {
         // include matrix_rte.js
         $theme_url = $this->EE->session->cache['matrix']['theme_url'];
         $this->EE->cp->add_to_foot('<script type="text/javascript" src="' . $theme_url . 'scripts/matrix_rte.js"></script>');
         $this->cache['displayed'] = TRUE;
     }
     $this->EE->load->add_package_path(PATH_MOD . 'rte/');
     $this->EE->load->library('rte_lib');
     //prep the data
     form_prep($data, $this->cell_name);
     //use the Rte_ft::display_field method
     $this->EE->load->library('rte_lib');
     $cell = array('data' => $this->EE->rte_lib->display_field($data, $this->cell_name, $this->settings), 'class' => 'matrix-rte');
     return $cell;
 }
Пример #16
0
function printButton($school, $userdata)
{
    $selected = FALSE;
    echo "<p>" . "<button type=\"submit\" name=\"school\" id=\"school\" " . "value=\"";
    echo form_prep($school->crm_school);
    echo "\"";
    echo "class=\"btn btn-lg btn-block ";
    if ($userdata !== false && $userdata == $school->crm_school) {
        echo "btn-success";
        $selected = true;
    } else {
        echo "btn-warning";
        $selected = false;
    }
    echo "\">";
    echo form_prep($school->school);
    echo "</button>" . "</p>\n";
    return $selected;
}
function set_checkbox($field = '', $value = '', $default = '')
{
    $OBJ =& _get_validation_object();
    if ($OBJ === TRUE && isset($OBJ->_field_data[$field])) {
        return form_prep($OBJ->set_checkbox($field, $value, $default));
    } else {
        if (!isset($_POST[$field])) {
            if (isset($default) && $default == TRUE) {
                return 'checked=\'checked\'';
            } else {
                return '';
            }
        } else {
            if ($_POST[$field] == $value) {
                return 'checked=\'checked\'';
            }
        }
    }
}
Пример #18
0
function printButton($db_region, $region)
{
    $selected = FALSE;
    echo "<p>" . "<button type=\"submit\" name=\"provincie\" id=\"provincie\" " . "value=\"";
    echo form_prep($db_region->crm_name);
    echo "\"";
    echo "class=\"btn btn-lg btn-block ";
    if ($region !== false && $region == $db_region->crm_name) {
        $selected = true;
        echo "btn-success";
    } else {
        $selected = false;
        echo "btn-warning";
    }
    echo "\">";
    echo form_prep($db_region->name);
    echo "</button>" . "</p>\n";
    return $selected;
}
Пример #19
0
 /**
  * Main login form
  *
  * @access	public
  * @return	void
  */
 function index()
 {
     // If an ajax request ends up here the user is probably logged out
     if (AJAX_REQUEST) {
         $this->output->set_status_header(401);
         die('C=login');
     }
     $username = $this->session->flashdata('username');
     $vars = array('return_path' => '', 'focus_field' => $username ? 'password' : 'username', 'username' => $username ? form_prep($username) : '', 'message' => $this->input->get('auto_expire') ? lang('session_auto_timeout') : $this->session->flashdata('message'));
     if ($this->input->get('BK')) {
         $vars['return_path'] = base64_encode($this->input->get('BK'));
     } else {
         if ($this->input->get('return')) {
             $vars['return_path'] = $this->input->get('return');
         }
     }
     $this->cp->set_variable('return_path', SELF);
     $this->cp->set_variable('cp_page_title', lang('login'));
     $this->load->view('account/login', $vars);
 }
Пример #20
0
 function build()
 {
     $output = '';
     $this->_getValue();
     switch ($this->status) {
         case 'disabled':
         case 'show':
             if (!isset($this->value)) {
                 $output = RAPYD_FIELD_SYMBOL_NULL;
             } elseif ($this->value == "") {
                 $output = "";
             } else {
                 $output = $this->value;
             }
             break;
         case 'create':
         case 'modify':
             $onchange = '';
             $onclick = '';
             if ($this->onchange != '') {
                 $onchange = ' onchange="' . $this->onchange . '"';
             }
             if ($this->onclick != '') {
                 $onclick = ' onclick="' . $this->onclick . '"';
             }
             $id = ' id="' . $this->name . '"';
             if (!empty($this->title)) {
                 $title = ' title = "' . form_prep($this->title) . '" ';
             } else {
                 $title = '';
             }
             $output = form_checkbox($this->name, $this->true_value, $this->checked, $id . $onchange . $title . $onclick) . $this->extra_output;
             break;
         case 'hidden':
             $output = form_hidden($this->name, $this->value);
             break;
         default:
     }
     $this->output = $output;
 }
Пример #21
0
function form_hidden($name, $value = '', $recursing = FALSE, $attr = '')
{
    static $form;
    if ($recursing === FALSE) {
        $form = "\n";
    }
    if (is_array($name)) {
        foreach ($name as $key => $val) {
            form_hidden($key, $val, TRUE);
        }
        return $form;
    }
    if (!is_array($value)) {
        $form .= '<input type="hidden" ' . $attr . ' name="' . $name . '" value="' . form_prep($value, $name) . '" />' . "\n";
    } else {
        foreach ($value as $k => $v) {
            $k = is_int($k) ? '' : $k;
            form_hidden($name . '[' . $k . ']', $v, TRUE);
        }
    }
    return $form;
}
function table_torch_field($item_desc, $row = NULL, $disabled = NULL)
{
    $CI =& get_instance();
    $humanize = $CI->config->item('table_torch_humanize_fields');
    if ($disabled == TRUE) {
        $disabled = 'disabled';
    }
    $field = $item_desc['Field'];
    if ($row != NULL) {
        $value = $row[$item_desc['Field']];
    } else {
        $value = $item_desc['Default'];
    }
    if ($item_desc['Key'] == 'PRI' and $row != NULL) {
        $disabled = 'disabled';
    }
    $fieldname = $field;
    if ($humanize) {
        $fieldname = humanize($fieldname);
    }
    $str = form_label($fieldname);
    if (strpos($item_desc['Type'], 'tinyint') !== FALSE or strpos($item_desc['Type'], 'enum') !== FALSE) {
        if ($disabled == NULL) {
            $str .= form_hidden($field, 0);
        }
        $checked = '';
        if ($value == TRUE or $value == 1) {
            $checked = 'checked';
        }
        $str .= "<input type=\"checkbox\" name=\"{$field}\" value=\"1\" {$checked} {$disabled}/>\n";
    } else {
        if ($item_desc['Type'] == 'text' or $item_desc['Type'] == 'longtext' or $item_desc['Type'] == 'blob') {
            $str .= "<textarea name=\"{$field}\" {$disabled}>" . form_prep($value) . "</textarea>\n";
        } else {
            $str .= "<input type=\"text\" name=\"{$field}\" value=\"" . form_prep($value) . "\" {$disabled} />\n";
        }
    }
    return $str;
}
Пример #23
0
    /**
     * Template Preferences Manager
     *
     * @access	public
     * @return	type
     */
    function template_preferences_manager($message = '')
    {
        if (!$this->cp->allowed_group('can_access_design') or !$this->cp->allowed_group('can_admin_templates')) {
            show_error($this->lang->line('unauthorized_access'));
        }
        if ($this->input->get_post('id') !== '') {
            $group_id = $this->input->get_post('id');
        }
        $vars['message'] = $message;
        $vars['show_template_manager'] = TRUE;
        // in an error condition, this will go false
        if ($this->session->userdata['group_id'] != 1 && (count($this->session->userdata['assigned_template_groups']) == 0 or $this->cp->allowed_group('can_admin_templates') == FALSE)) {
            $vars['message'] = $this->lang->line('no_templates_assigned');
            $vars['show_template_manager'] = FALSE;
            return $this->load->view('design/template_preferences_manager', $vars);
        }
        $this->load->helper('form');
        $this->load->library('table');
        $this->javascript->output('		
			// select all options for template access restrictions
			$("input.select_all").click(function(){
				$("input[class="+$(this).val()+"]").each(function() {
					this.checked = true;
				});
			});
			
			var the_templates = $(\'div[id^="template_group_div_"]\');
		
			$("#template_groups").change(function() {
				the_templates.hide();
				var openDivs = $(this).val().toString()
				var ids = new Array();
				ids = openDivs.split(",");
								
				for(i=0;i<ids.length;i++)
				{
					$("#template_group_div_"+ids[i]).show();
				}
		
				return false;
			});
		');
        // Retrieve Valid Template Groups and Templates
        $this->db->from('template_groups tg, templates t');
        $this->db->select('tg.group_id, tg.group_name, t.template_id, t.template_name');
        $this->db->where('tg.group_id = t.group_id');
        $this->db->where('tg.site_id', $this->config->item('site_id'));
        if ($this->session->userdata['group_id'] != 1) {
            $this->db->where_in('t.group_id', array_keys($this->session->userdata['assigned_template_groups']));
        }
        $this->db->order_by('tg.group_order, t.group_id, t.template_name');
        $query = $this->db->get();
        if ($query->num_rows() == 0) {
            $vars['message'] = $this->lang->line('no_templates_available');
            $vars['show_template_manager'] = FALSE;
            return $this->load->view('design/template_preferences_manager', $vars);
        }
        // Create MultiSelect Lists
        $current_group = 0;
        $groups = array();
        $tmpl = array();
        $vars['templates'] = array();
        foreach ($query->result_array() as $i => $row) {
            if ($row['group_id'] != $current_group) {
                $groups[$row['group_id']] = form_prep($row['group_name']);
                if ($current_group != 0) {
                    $vars['templates']['template_group_div_' . $current_group]['select'] = form_multiselect('template_group_' . $row['group_id'] . '[]', $tmpl, '', "size='8' class='multiselect' style='width:45%'");
                    $vars['templates']['template_group_div_' . $current_group]['active'] = $current_group == $group_id ? TRUE : FALSE;
                    $tmpl = array();
                }
            }
            $tmpl[$row['template_id']] = form_prep($row['template_name']);
            $current_group = $row['group_id'];
        }
        $groups = form_multiselect('template_groups', $groups, $group_id, "id='template_groups' size='10' class='multiselect' style='width:160px'");
        $vars['templates']['template_group_div_' . $current_group]['select'] = form_multiselect('template_group_' . $row['group_id'] . '[]', $tmpl, '', "size='8' class='multiselect' style='width:45%'");
        $vars['templates']['template_group_div_' . $current_group]['active'] = $current_group == $group_id ? TRUE : FALSE;
        $vars['groups'] = $groups;
        if ($this->input->get_post('U')) {
            $vars['message'] = $this->lang->line('preferences_updated');
        }
        // Template Preference Headings
        $headings = array(array('template_type', $this->lang->line('type')), array('cache', $this->lang->line('cache_enable')), array('refresh', $this->lang->line('refresh_interval') . ' <small>(' . $this->lang->line('refresh_in_minutes') . ')</small>'));
        if ($this->session->userdata['group_id'] == 1) {
            $headings[] = array('allow_php', $this->lang->line('enable_php') . ' <span class="notice">*</span>');
            $headings[] = array('php_parse_location', $this->lang->line('parse_stage'));
        }
        if ($this->config->item('save_tmpl_files') == 'y' and $this->config->item('tmpl_file_basepath') != '') {
            $headings[] = array('save_template_file', $this->lang->line('save_template_file'));
        }
        $headings[] = array('hits', $this->lang->line('hit_counter'));
        $vars['headings'] = $headings;
        // Template Preference Options
        $vars['template_prefs'] = array();
        $template_type_options = array('null' => $this->lang->line('do_not_change'), 'css' => $this->lang->line('css_stylesheet'), 'js' => $this->lang->line('js'), 'feed' => $this->lang->line('rss'), 'static' => $this->lang->line('static'), 'webpage' => $this->lang->line('webpage'), 'xml' => $this->lang->line('xml'));
        $vars['template_prefs']['template_type'] = form_dropdown('template_type', $template_type_options, 'null', 'id="template_type"');
        $yes_no_options = array('null' => $this->lang->line('do_not_change'), 'y' => $this->lang->line('yes'), 'n' => $this->lang->line('no'));
        $vars['template_prefs']['cache'] = form_dropdown('cache', $yes_no_options, 'null', 'id="cache"');
        $vars['template_prefs']['refresh'] = form_input(array('name' => 'refresh', 'value' => '0', 'size' => 5));
        if ($this->session->userdata['group_id'] == 1) {
            $php_i_o_options = array('null' => $this->lang->line('do_not_change'), 'i' => $this->lang->line('input'), 'o' => $this->lang->line('output'));
            $vars['template_prefs']['allow_php'] = form_dropdown('allow_php', $yes_no_options, 'null', 'id="allow_php"');
            $vars['template_prefs']['php_parse_location'] = form_dropdown('php_parse_location', $php_i_o_options, 'null', 'id="php_parse_location"');
        }
        if ($this->config->item('save_tmpl_files') == 'y' and $this->config->item('tmpl_file_basepath') != '') {
            $vars['template_prefs']['save_template_file'] = form_dropdown('save_template_file', $yes_no_options, 'null', 'id="save_template_file"');
        }
        $vars['template_prefs']['hits'] = form_input(array('name' => 'hits', 'value' => '', 'size' => 5));
        // Template Access Restrictions
        $this->db->select('group_id, group_title');
        $this->db->where('site_id', $this->config->item('site_id'));
        $this->db->where('group_id !=', '1');
        $this->db->order_by('group_title');
        $query = $this->db->get('member_groups');
        $vars['template_access'] = array();
        foreach ($query->result() as $row) {
            $vars['template_access'][$row->group_id][] = $row->group_title;
            $radio_options = '';
            foreach ($yes_no_options as $key => $lang) {
                $radio_options .= '<label>' . form_radio('access_' . $row->group_id, $key, '', 'class="access_' . $key . '"') . NBS . $lang . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
            }
            $vars['template_access'][$row->group_id][] = $radio_options;
        }
        $vars['template_access']['select_all'][] = $this->lang->line('select_all');
        $select_all_radios = '<label>' . form_radio('select_all', 'access_null', '', 'class="select_all"') . NBS . $this->lang->line('do_not_change') . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
        $select_all_radios .= '<label>' . form_radio('select_all', 'access_y', '', 'class="select_all"') . NBS . $this->lang->line('yes') . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
        $select_all_radios .= '<label>' . form_radio('select_all', 'access_n', '', 'class="select_all"') . NBS . $this->lang->line('no') . '</label>';
        $vars['template_access']['select_all'][] = $select_all_radios;
        $this->db->select('template_groups.group_name, templates.template_name, templates.template_id');
        $this->db->where('template_groups.group_id = ' . $this->db->dbprefix('templates.group_id'));
        $this->db->where('template_groups.site_id', $this->config->item('site_id'));
        $this->db->order_by('template_groups.group_name, templates.template_name');
        $query = $this->db->get(array('template_groups', 'templates'));
        $vars['no_auth_bounce_options']['null'] = $this->lang->line('do_not_change');
        foreach ($query->result() as $row) {
            $vars['no_auth_bounce_options'][$row->template_id] = $row->group_name . '/' . $row->template_name;
        }
        $vars['enable_http_auth_options'] = $yes_no_options;
        $this->cp->set_variable('cp_page_title', $this->lang->line('template_preferences_manager'));
        $this->cp->set_breadcrumb(BASE . AMP . 'C=design' . AMP . 'M=manager', $this->lang->line('template_manager'));
        $this->javascript->compile();
        $this->load->view('design/template_preferences_manager', $vars);
    }
Пример #24
0
 function _get_field_options($data)
 {
     $field_options = array();
     if (isset($this->settings['field_pre_populate']) && $this->settings['field_pre_populate'] == 'n' or !isset($this->settings['field_pre_populate'])) {
         if (!is_array($this->settings['field_list_items'])) {
             foreach (explode("\n", trim($this->settings['field_list_items'])) as $v) {
                 $v = trim($v);
                 $field_options[form_prep($v)] = form_prep($v);
             }
         } else {
             $field_options = $this->settings['field_list_items'];
         }
     } else {
         // We need to pre-populate this menu from an another channel custom field
         ee()->db->select('field_id_' . $this->settings['field_pre_field_id']);
         ee()->db->where('channel_id', $this->settings['field_pre_channel_id']);
         $pop_query = ee()->db->get('channel_data');
         $field_options[''] = '--';
         if ($pop_query->num_rows() > 0) {
             foreach ($pop_query->result_array() as $prow) {
                 $selected = $prow['field_id_' . $this->settings['field_pre_field_id']] == $data ? 1 : '';
                 $pretitle = substr($prow['field_id_' . $this->settings['field_pre_field_id']], 0, 110);
                 $pretitle = str_replace(array("\r\n", "\r", "\n", "\t"), " ", $pretitle);
                 $pretitle = form_prep($pretitle);
                 $field_options[form_prep($prow['field_id_' . $this->settings['field_pre_field_id']])] = $pretitle;
             }
         }
     }
     return $field_options;
 }
Пример #25
0
Файл: view.php Проект: nukem/NEC
    ?>
 <tr>
	<td>&nbsp;<?php 
    echo anchor(array($base_uri, 'edit', $row->{$primary}), $scaff_edit);
    ?>
&nbsp;</td>
 	<td><?php 
    echo anchor(array($base_uri, 'delete', $row->{$primary}), $scaff_delete);
    ?>
</td>
 	<?php 
    foreach ($fields as $field) {
        ?>
	
	<td><?php 
        echo form_prep($row->{$field});
        ?>
</td>
	<?php 
    }
    ?>
 </tr>
<?php 
}
?>
</table>

<?php 
echo $paginate;
?>
Пример #26
0
 /**
  * Get Form Statuses
  *
  * returns an array of form statuses
  *
  * @access	public
  * @return	array
  */
 public function get_form_statuses()
 {
     $statuses = array();
     foreach ($this->form_statuses as $status) {
         $statuses[$status] = lang($status);
     }
     $pref_statuses = $this->preference('form_statuses');
     if ($pref_statuses) {
         foreach ($pref_statuses as $status) {
             $statuses[form_prep($status)] = form_prep($status);
         }
     }
     return $statuses;
 }
Пример #27
0
}
?>
    
</datalist>  
        
  <p> Diploma type en sub type: <br>
    <input list="diploma_list" name="diploma" id="diploma"
           class="form-control input-lg" 
           placeholder="Kies uw diploma hier."
           
<?php 
if (isset($diploma) && $diploma != '') {
    if (isset($diplomaSub) && $diplomaSub != '') {
        echo 'value="' . form_prep($diploma) . "_" . form_prep($diplomaSub) . '">';
    } else {
        echo 'value="' . form_prep($diploma) . '">';
    }
} else {
    $set_diplomaSub = set_value('diplomaSub');
    if (isset($set_diplomaSub) && $set_diplomaSub != '') {
        echo 'value="' . set_value('diploma') . "_" . $set_diplomaSub . '">';
    } else {
        echo 'value="' . set_value('diploma') . '">';
    }
}
?>
  </p>
  <p> Graduatie Jaar:<br>
<?php 
$this->load->helper('date');
$jaar = date('Y');
Пример #28
0
    <p class="clear">&nbsp;</p>
    <label><?php 
        echo __('Profile');
        ?>
:</label>
    <br/>
    <textarea class="txtFld" name="user[<?php 
        echo $k;
        ?>
][profile]" cols="80" rows="15"
              id="user_<?php 
        echo $k;
        ?>
_profile"><?php 
        echo form_prep($v['profile']);
        ?>
</textarea>
    <p class="clear">&nbsp;</p><br/>

    <div class="editSeparator">&nbsp;</div>

    <?php 
    }
    ?>
    <label>&nbsp;</label><input class="btn btn-primary" name="edit" type="submit" id="edit"
                                value="Update"/>&nbsp;<?php 
    echo anchor('admin/user', __('BACK'));
    ?>

    <p class="clear">&nbsp;</p>
Пример #29
0
 /**
  * Form declaration
  *
  * This function is used by modules when they need to create forms
  *
  * @access	public
  * @param	string
  * @return	string
  */
 public function form_declaration($data)
 {
     // Load the form helper
     ee()->load->helper('form');
     $deft = array('hidden_fields' => array(), 'action' => '', 'id' => '', 'class' => '', 'secure' => TRUE, 'enctype' => '', 'onsubmit' => '');
     foreach ($deft as $key => $val) {
         if (!isset($data[$key])) {
             $data[$key] = $val;
         }
     }
     if (is_array($data['hidden_fields']) && !isset($data['hidden_fields']['site_id'])) {
         $data['hidden_fields']['site_id'] = ee()->config->item('site_id');
     }
     // -------------------------------------------
     // 'form_declaration_modify_data' hook.
     //  - Modify the $data parameters before they are processed
     //  - Added EE 1.4.0
     //
     if (ee()->extensions->active_hook('form_declaration_modify_data') === TRUE) {
         $data = ee()->extensions->call('form_declaration_modify_data', $data);
     }
     //
     // -------------------------------------------
     // -------------------------------------------
     // 'form_declaration_return' hook.
     //  - Take control of the form_declaration function
     //  - Added EE 1.4.0
     //
     if (ee()->extensions->active_hook('form_declaration_return') === TRUE) {
         $form = ee()->extensions->call('form_declaration_return', $data);
         if (ee()->extensions->end_script === TRUE) {
             return $form;
         }
     }
     //
     // -------------------------------------------
     if ($data['action'] == '') {
         $data['action'] = $this->fetch_site_index();
     }
     if ($data['onsubmit'] != '') {
         $data['onsubmit'] = 'onsubmit="' . trim($data['onsubmit']) . '"';
     }
     if (substr($data['action'], -1) == '?') {
         $data['action'] = substr($data['action'], 0, -1);
     }
     $data['name'] = isset($data['name']) && $data['name'] != '' ? 'name="' . $data['name'] . '" ' : '';
     $data['id'] = $data['id'] != '' ? 'id="' . $data['id'] . '" ' : '';
     $data['class'] = $data['class'] != '' ? 'class="' . $data['class'] . '" ' : '';
     if ($data['enctype'] == 'multi' or strtolower($data['enctype']) == 'multipart/form-data') {
         $data['enctype'] = 'enctype="multipart/form-data" ';
     }
     $form = '<form ' . $data['id'] . $data['class'] . $data['name'] . 'method="post" action="' . $data['action'] . '" ' . $data['onsubmit'] . ' ' . $data['enctype'] . ">\n";
     if ($data['secure'] == TRUE) {
         unset($data['hidden_fields']['XID']);
         $data['hidden_fields']['csrf_token'] = '{csrf_token}';
         // we use the tag instead of the constant to allow caching of the template
     }
     if (is_array($data['hidden_fields'])) {
         $form .= "<div class='hiddenFields'>\n";
         foreach ($data['hidden_fields'] as $key => $val) {
             $form .= '<input type="hidden" name="' . $key . '" value="' . form_prep($val) . '" />' . "\n";
         }
         $form .= "</div>\n\n";
     }
     return $form;
 }
Пример #30
0
            <label class="control-label">
                <?php 
    echo $custom_field->custom_field_label;
    ?>
            </label>
            <input type="text" class="form-control"
                   name="custom[<?php 
    echo $custom_field->custom_field_column;
    ?>
]"
                   id="<?php 
    echo $custom_field->custom_field_column;
    ?>
"
                   value="<?php 
    echo form_prep($this->mdl_quotes->form_value('custom[' . $custom_field->custom_field_column . ']'));
    ?>
">
        <?php 
}
?>

        <?php 
if ($quote->quote_status_id != 1) {
    ?>
            <p class="padded">
                <?php 
    echo lang('guest_url');
    ?>
:
                <?php