当前位置: 首页>>代码示例>>PHP>>正文


PHP param_errors_detected函数代码示例

本文整理汇总了PHP中param_errors_detected函数的典型用法代码示例。如果您正苦于以下问题:PHP param_errors_detected函数的具体用法?PHP param_errors_detected怎么用?PHP param_errors_detected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了param_errors_detected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     param_string_not_empty('pst_name', T_('Please enter a name.'));
     $this->set_from_Request('name');
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:12,代码来源:_itemstatus.class.php

示例2: load_from_request

 /**
  * Load data from Request form fields.
  *
  * @todo fp> check that we are not creating a loop!
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_request()
 {
     parent::load_from_Request();
     if (param($this->dbprefix . 'parent_ID', 'integer', -1) !== -1) {
         $this->set_from_Request('parent_ID');
     }
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:15,代码来源:_genericcategory.class.php

示例3: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     $this->set_string_from_param('name', true);
     // Color
     $color = param('gcat_color', 'string', '');
     param_check_color('gcat_color', T_('Invalid color code.'), true);
     $this->set_string_from_param('color', true);
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:15,代码来源:_goalcat.class.php

示例4: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     param_string_not_empty('ufgp_name', T_('Please enter a group name.'));
     $this->set_from_Request('name');
     // Order
     param_string_not_empty('ufgp_order', T_('Please enter an order number.'));
     $this->set_from_Request('order');
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:15,代码来源:_userfieldgroup.class.php

示例5: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     param('org_name', 'string');
     param_check_not_empty('org_name', T_('You must provide a name!'));
     $this->set_from_Request('name', 'org_name');
     // Url
     param('org_url', 'string');
     param_check_url('org_url', 'commenting');
     $this->set_from_Request('url', 'org_url', true);
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:17,代码来源:_organization.class.php

示例6: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     $this->set_string_from_param('name', true);
     // Shortcut
     $this->set_string_from_param('shortcut', true);
     // Code
     param('curr_code', 'string');
     param_check_regexp('curr_code', '#^[A-Za-z]{3}$#', T_('Currency code must be 3 letters.'));
     $this->set_from_Request('code', 'curr_code', true);
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:17,代码来源:_currency.class.php

示例7: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // get new ID
     if (param('new_ptyp_ID', 'string', NULL) !== NULL) {
         param_check_number('new_ptyp_ID', T_('ID must be a number.'), true);
         $this->set_from_Request('ID', 'new_ptyp_ID');
     }
     // Name
     param_string_not_empty('ptyp_name', T_('Please enter a name.'));
     $this->set_from_Request('name');
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:17,代码来源:_itemtype.class.php

示例8: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     $this->set_string_from_param('name', true);
     // Code
     param('ctry_code', 'string');
     param_check_regexp('ctry_code', '#^[A-Za-z]{2}$#', T_('Country code must be 2 letters.'));
     $this->set_from_Request('code', 'ctry_code');
     // Currency Id
     param('ctry_curr_ID', 'integer');
     param_check_number('ctry_curr_ID', T_('Please select a currency'));
     $this->set_from_Request('curr_ID', 'ctry_curr_ID', true);
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:19,代码来源:_country.class.php

示例9: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Country Id
     param('rgn_ctry_ID', 'integer', true);
     param_check_number('rgn_ctry_ID', T_('Please select a country'), true);
     $this->set_from_Request('ctry_ID', 'rgn_ctry_ID', true);
     // Name
     $this->set_string_from_param('name', true);
     // Code
     param('rgn_code', 'string');
     param_check_regexp('rgn_code', '#^[A-Za-z0-9]{1,6}$#', T_('Region code must be from 1 to 6 letters.'));
     $this->set_from_Request('code', 'rgn_code');
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:19,代码来源:_region.class.php

示例10: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Country Id
     param('city_ctry_ID', 'integer', true);
     param_check_number('city_ctry_ID', T_('Please select a country'), true);
     $this->set_from_Request('ctry_ID', 'city_ctry_ID', true);
     // Region Id
     $this->set_string_from_param('rgn_ID');
     // Subregion Id
     $this->set_string_from_param('subrg_ID');
     // Name
     $this->set_string_from_param('name', true);
     // Code
     param('city_postcode', 'string');
     param_check_regexp('city_postcode', '#^[A-Za-z0-9]{1,12}$#', T_('City code must be from 1 to 12 letters.'));
     $this->set_from_Request('postcode', 'city_postcode');
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:23,代码来源:_city.class.php

示例11: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     param_string_not_empty('dom_name', T_('Please enter domain name.'));
     $dom_name = get_param('dom_name');
     $this->set('name', $dom_name);
     $dom_status = param('dom_status', 'string', true);
     $this->set('status', $dom_status, true);
     $dom_type = param('dom_type', 'string', true);
     $this->set('type', $dom_type, true);
     if (!param_errors_detected()) {
         // Check domains with the same name and type
         global $Messages, $DB;
         $SQL = new SQL();
         $SQL->SELECT('dom_ID');
         $SQL->FROM('T_basedomains');
         $SQL->WHERE('dom_ID != ' . $this->ID);
         $SQL->WHERE_and('dom_name = ' . $DB->quote($dom_name));
         $SQL->WHERE_and('dom_type = ' . $DB->quote($dom_type));
         if ($DB->get_var($SQL->get())) {
             $Messages->add(T_('Domain already exists with the same name and type.'));
         }
     }
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:29,代码来源:_domain.class.php

示例12: load_from_Request


//.........这里部分代码省略.........
         // Update the name only of not special post types
         param_string_not_empty('ityp_name', T_('Please enter a name.'));
         $this->set_from_Request('name');
     }
     // Description
     param('ityp_description', 'text');
     $this->set_from_Request('description', NULL, true);
     // Permission level
     param('ityp_perm_level', 'string');
     $this->set_from_Request('perm_level');
     // Back-office tab
     param('ityp_backoffice_tab', 'string');
     $this->set_from_Request('backoffice_tab', NULL, true);
     // Template name
     param('ityp_template_name', 'string');
     $this->set_from_Request('template_name', NULL, true);
     // Use title
     param('ityp_use_title', 'string');
     $this->set_from_Request('use_title');
     // Use URL
     param('ityp_use_url', 'string');
     $this->set_from_Request('use_url');
     // Use Parent ID
     param('ityp_use_parent', 'string');
     $this->set_from_Request('use_parent');
     // Use text
     param('ityp_use_text', 'string');
     $this->set_from_Request('use_text');
     // Allow HTML
     param('ityp_allow_html', 'integer', 0);
     $this->set_from_Request('allow_html');
     // Allow Teaser and Page breaks
     param('ityp_allow_breaks', 'integer', 0);
     $this->set_from_Request('allow_breaks');
     // Allow attachments
     param('ityp_allow_attachments', 'integer', 0);
     $this->set_from_Request('allow_attachments');
     // Use excerpt
     param('ityp_use_excerpt', 'string');
     $this->set_from_Request('use_excerpt');
     // Use title tag
     param('ityp_use_title_tag', 'string');
     $this->set_from_Request('use_title_tag');
     // Use meta description
     param('ityp_use_meta_desc', 'string');
     $this->set_from_Request('use_meta_desc');
     // Use meta keywords
     param('ityp_use_meta_keywds', 'string');
     $this->set_from_Request('use_meta_keywds');
     // Use tags
     param('ityp_use_tags', 'string');
     $this->set_from_Request('use_tags');
     // Allow featured
     param('ityp_allow_featured', 'integer', 0);
     $this->set_from_Request('allow_featured');
     // Use country, region, sub-region, city:
     $use_country = param('ityp_use_country', 'string', 'never');
     $use_region = param('ityp_use_region', 'string', 'never');
     $use_sub_region = param('ityp_use_sub_region', 'string', 'never');
     $use_city = param('ityp_use_city', 'string', 'never');
     if ($use_city == 'required') {
         // If city is required - all location fields also are required
         $use_country = $use_region = $use_sub_region = 'required';
     } else {
         if ($use_sub_region == 'required') {
             // If subregion is required - country & region fields also are required
             $use_country = $use_region = 'required';
         } else {
             if ($use_region == 'required') {
                 // If region is required - country field also is required
                 $use_country = 'required';
             }
         }
     }
     $this->set('use_country', $use_country);
     $this->set('use_region', $use_region);
     $this->set('use_sub_region', $use_sub_region);
     $this->set('use_city', $use_city);
     // Use coordinates
     param('ityp_use_coordinates', 'string');
     $this->set_from_Request('use_coordinates');
     // Use custom fields
     param('ityp_use_custom_fields', 'integer', 0);
     $this->set_from_Request('use_custom_fields');
     // Use comments
     param('ityp_use_comments', 'integer', 0);
     $this->set_from_Request('use_comments');
     // Allow closing comments
     param('ityp_allow_closing_comments', 'integer', 0);
     $this->set_from_Request('allow_closing_comments');
     // Allow disabling comments
     param('ityp_allow_disabling_comments', 'integer', 0);
     $this->set_from_Request('allow_disabling_comments');
     // Use comment expiration
     param('ityp_use_comment_expiration', 'string');
     $this->set_from_Request('use_comment_expiration');
     // Load custom fields from request
     $this->load_custom_fields_from_Request();
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_itemtype.class.php

示例13: load_from_Request


//.........这里部分代码省略.........
      */
     $this->filters['statuses'] = param($this->param_prefix . 'status', '/^(-|-[0-9]+|[0-9]+)(,[0-9]+)*$/', $this->default_filters['statuses'], true);
     // List of statuses to restrict to
     /*
      * Restrict to selected types:
      */
     $this->filters['types'] = param($this->param_prefix . 'types', '/^(-|-[0-9]+|[0-9]+)(,[0-9]+)*$/', $this->default_filters['types'], true);
     // List of types to restrict to
     /*
      * Restrict by keywords
      */
     $this->filters['keywords'] = param($this->param_prefix . 's', 'string', $this->default_filters['keywords'], true);
     // Search string
     $this->filters['keyword_scope'] = param($this->param_prefix . 'scope', 'string', $this->default_filters['keyword_scope'], true);
     // Scope of search string
     $this->filters['phrase'] = param($this->param_prefix . 'sentence', 'string', $this->default_filters['phrase'], true);
     // Search for sentence or for words
     $this->filters['exact'] = param($this->param_prefix . 'exact', 'integer', $this->default_filters['exact'], true);
     // Require exact match of title or contents
     /*
      * Specific Item selection?
      */
     $this->filters['post_ID'] = param($this->param_prefix . 'p', 'integer', $this->default_filters['post_ID']);
     // Specific post number to display
     $this->filters['post_title'] = param($this->param_prefix . 'title', 'string', $this->default_filters['post_title']);
     // urtitle of post to display
     /*
      * multiple Item selection ?
      */
     $this->filters['post_ID_list'] = param($this->param_prefix . 'pl', 'string', $this->default_filters['post_ID_list']);
     // Specific list of post numbers to display
     $this->single_post = !empty($this->filters['post_ID']) || !empty($this->filters['post_title']);
     /*
      * If a timeframe is specified in the querystring, restrict to that timeframe:
      */
     $this->filters['ymdhms'] = param($this->param_prefix . 'm', '/^\\d{4}(0[1-9]|1[0-2])?(?(1)(0[1-9]|[12][0-9]|3[01])?)(?(2)([01][0-9]|2[0-3])?)(?(3)([0-5][0-9]){0,2})$/', $this->default_filters['ymdhms'], true);
     // YearMonth(Day) to display
     $this->filters['week'] = param($this->param_prefix . 'w', '/^(0?[0-9]|[1-4][0-9]|5[0-3])$/', $this->default_filters['week'], true);
     // Week number (0?0-53)
     $this->filters['ymdhms_min'] = param_compact_date($this->param_prefix . 'dstart', $this->default_filters['ymdhms_min'], true, T_('Invalid date'));
     // YearMonth(Day) to start at
     $this->filters['ymdhms_max'] = param_compact_date($this->param_prefix . 'dstop', $this->default_filters['ymdhms_max'], true, T_('Invalid date'));
     // YearMonth(Day) to stop at
     // TODO: show_past/future should probably be wired on dstart/dstop instead on timestamps -> get timestamps out of filter perimeter
     // So far, these act as SILENT filters. They will not advertise their filtering in titles etc.
     $this->filters['ts_min'] = $this->default_filters['ts_min'];
     $this->filters['ts_max'] = $this->default_filters['ts_max'];
     if (is_null($this->default_filters['ts_min']) && is_null($this->default_filters['ts_max'])) {
         // We have not set a strict default -> we allow overridding:
         $show_past = param($this->param_prefix . 'show_past', 'integer', 0, true);
         $show_future = param($this->param_prefix . 'show_future', 'integer', 0, true);
         if ($show_past != $show_future) {
             // There is a point in overridding:
             $this->filters['ts_min'] = $show_past == 0 ? 'now' : '';
             $this->filters['ts_max'] = $show_future == 0 ? 'now' : '';
         }
     }
     /*
      * Restrict to the statuses we want to show:
      */
     // Note: oftentimes, $show_statuses will have been preset to a more restrictive set of values
     $this->filters['visibility_array'] = param($this->param_prefix . 'show_statuses', 'array:string', $this->default_filters['visibility_array'], true, false, true, false);
     // Array of sharings to restrict to
     /*
      * Ordering:
      */
     $this->filters['order'] = param($this->param_prefix . 'order', '/^(ASC|asc|DESC|desc)$/', $this->default_filters['order'], true);
     // ASC or DESC
     // This order style is OK, because sometimes the commentList is not displayed on a table so we cannot say we want to order by a specific column. It's not a crap.
     $this->filters['orderby'] = param($this->param_prefix . 'orderby', '/^([A-Za-z0-9_]+([ ,][A-Za-z0-9_]+)*)?$/', $this->default_filters['orderby'], true);
     // list of fields to order by (TODO: change that crap)
     /*
      * Paging limits:
      */
     $this->filters['unit'] = param($this->param_prefix . 'unit', 'string', $this->default_filters['unit'], true);
     // list unit: 'posts' or 'days'
     $this->filters['posts'] = param($this->param_prefix . 'posts', 'integer', $this->default_filters['posts'], true);
     // # of units to display on the page
     $this->limit = $this->filters['posts'];
     // for compatibility with parent class
     // 'paged'
     $this->filters['page'] = param($this->page_param, 'integer', 1, true);
     // List page number in paged display
     $this->page = $this->filters['page'];
     if (param_errors_detected()) {
         return false;
     }
     if ($this->single_post) {
         // We have requested a specific post
         // Do not attempt to save or load any filterset:
         return true;
     }
     //echo ' Got filters from URL?:'.($this->is_filtered() ? 'YES' : 'NO');
     //pre_dump( $this->default_filters );
     //pre_dump( $this->filters );
     if ($use_filters && $filter_action == 'save') {
         $this->save_filterset();
     }
     return true;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_itemlistlight.class.php

示例14: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     global $Messages;
     $aipr_status = param('aipr_status', 'string', true);
     $this->set('status', $aipr_status, true);
     $aipr_IPv4start = param('aipr_IPv4start', 'string', true);
     param_check_regexp('aipr_IPv4start', '#^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$#i', T_('Please enter a correct IP range start'));
     $aipr_IPv4start = ip2int($aipr_IPv4start);
     $this->set('IPv4start', $aipr_IPv4start);
     $aipr_IPv4end = param('aipr_IPv4end', 'string', true);
     param_check_regexp('aipr_IPv4end', '#^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$#i', T_('Please enter a correct IP range end'));
     $aipr_IPv4end = ip2int($aipr_IPv4end);
     $this->set('IPv4end', $aipr_IPv4end);
     // start timestamp:
     param_date('aipr_IP_timestamp', T_('Please enter a valid Date.'), true);
     $this->set('IP_datetime', form_date(get_param('aipr_IP_timestamp')));
     if ($aipr_IPv4start > $aipr_IPv4end) {
         $Messages->add(T_('IP range start must be less than IP range end'), 'error');
     }
     if (!param_errors_detected()) {
         // Check IPs for inside in other ranges
         if ($ip_range = get_ip_range($aipr_IPv4start, $aipr_IPv4end, $this->ID)) {
             $admin_url;
             $Messages->add(sprintf(T_('IP range already exists with params: %s - <a %s>Edit this range</a>'), int2ip($ip_range->aipr_IPv4start) . ' - ' . int2ip($ip_range->aipr_IPv4end), 'href="' . $admin_url . '?ctrl=antispam&amp;tab3=ipranges&amp;action=iprange_edit&amp;iprange_ID=' . $ip_range->aipr_ID . '"'), 'error');
         }
     }
     return !param_errors_detected();
 }
开发者ID:Edind304,项目名称:b2evolution,代码行数:33,代码来源:_iprange.class.php

示例15: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     global $Messages, $demo_mode;
     // Edited Group Name
     param('edited_grp_name', 'string');
     param_check_not_empty('edited_grp_name', T_('You must provide a group name!'));
     $this->set_from_Request('name', 'edited_grp_name', true);
     // Edited Group Permission Blogs
     param('edited_grp_perm_blogs', 'string', true);
     $this->set_from_Request('perm_blogs', 'edited_grp_perm_blogs', true);
     $apply_antispam = param('apply_antispam', 'integer', 0) ? 0 : 1;
     $perm_xhtmlvalidation = param('perm_xhtmlvalidation', 'string', true);
     $perm_xhtmlvalidation_xmlrpc = param('perm_xhtmlvalidation_xmlrpc', 'string', true);
     $prevent_css_tweaks = param('prevent_css_tweaks', 'integer', 0) ? 0 : 1;
     $prevent_iframes = param('prevent_iframes', 'integer', 0) ? 0 : 1;
     $prevent_javascript = param('prevent_javascript', 'integer', 0) ? 0 : 1;
     $prevent_objects = param('prevent_objects', 'integer', 0) ? 0 : 1;
     if ($demo_mode && ($apply_antispam || $perm_xhtmlvalidation != 'always' && $perm_xhtmlvalidation_xmlrpc != 'always' || $prevent_css_tweaks || $prevent_iframes || $prevent_javascript || $prevent_objects)) {
         // Demo mode restriction: Do not allow to change these settings in demo mode, because it may lead to security problem!
         $Messages->add('Validation settings and security filters are not editable in demo mode!', 'error');
     } else {
         // Apply Antispam
         $this->set('perm_bypass_antispam', $apply_antispam);
         // XHTML Validation
         $this->set('perm_xhtmlvalidation', $perm_xhtmlvalidation);
         // XHTML Validation XMLRPC
         $this->set('perm_xhtmlvalidation_xmlrpc', $perm_xhtmlvalidation_xmlrpc);
         // CSS Tweaks
         $this->set('perm_xhtml_css_tweaks', $prevent_css_tweaks);
         // Iframes
         $this->set('perm_xhtml_iframes', $prevent_iframes);
         // Javascript
         $this->set('perm_xhtml_javascript', $prevent_javascript);
         // Objects
         $this->set('perm_xhtml_objects', $prevent_objects);
     }
     // Stats
     $this->set('perm_stats', param('edited_grp_perm_stats', 'string', true));
     // Load pluggable group permissions from request
     $GroupSettings =& $this->get_GroupSettings();
     foreach ($GroupSettings->permission_values as $name => $value) {
         // We need to handle checkboxes and radioboxes separately , because when a checkbox isn't checked the checkbox variable is not sent
         if ($name == 'perm_createblog' || $name == 'perm_getblog' || $name == 'perm_templates') {
             // These two permissions are represented by checkboxes, all other pluggable group permissions are represented by radiobox.
             $value = param('edited_grp_' . $name, 'string', 'denied');
         } elseif (($name == 'perm_admin' || $name == 'perm_users') && $this->ID == 1) {
             // Admin group has always admin perm, it can not be set or changed.
             continue;
         } else {
             $value = param('edited_grp_' . $name, 'string', '');
         }
         if ($value != '' || $name == 'max_new_threads') {
             // if radio is not set, then doesn't change the settings
             $GroupSettings->set($name, $value, $this->ID);
         }
     }
     return !param_errors_detected();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:63,代码来源:_group.class.php


注:本文中的param_errors_detected函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。