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


PHP Field::checkFields方法代码示例

本文整理汇总了PHP中Field::checkFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::checkFields方法的具体用法?PHP Field::checkFields怎么用?PHP Field::checkFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Field的用法示例。


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

示例1: checkFields

 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_writable(DOCROOT . $this->get('destination') . '/')) {
         $errors['destination'] = 'Folder is not writable. Please check permissions.';
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:psychoticmeowArchives,项目名称:uploadfield,代码行数:7,代码来源:field.upload.php

示例2: checkFields

 public function checkFields(&$errors, $checkForDuplicates = TRUE)
 {
     parent::checkFields($errors, $checkForDuplicates);
     $related_fields = $this->get('related_sbl_id');
     if (empty($related_fields)) {
         $errors['related_sbl_id'] = __('This is a required field.');
     }
     return is_array($errors) && !empty($errors) ? self::__ERROR__ : self::__OK__;
 }
开发者ID:nickdunn,项目名称:member_replies,代码行数:9,代码来源:field.member_replies.php

示例3: checkFields

 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     parent::checkFields($errors, $checkForDuplicates);
     $this->rememberSalt();
     if (trim($this->get('salt')) == '') {
         $errors['salt'] = 'This is a required field.';
     }
 }
开发者ID:psychoticmeowArchives,项目名称:frontendmembermanager,代码行数:8,代码来源:field.memberpassword.php

示例4: checkFields

 /**
  * Checks fields for errors in section editor.
  *
  * @param array $errors
  * @param boolean $checkForDuplicates
  */
 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     $templates = $this->get('templates');
     if (empty($templates)) {
         $errors['templates'] = __('This is a required field.');
     }
     $senders = $this->get('senders');
     if (empty($senders)) {
         $errors['senders'] = __('This is a required field.');
     }
     $recipient_groups = $this->get('recipient_groups');
     if (empty($recipient_groups)) {
         $errors['recipient_groups'] = __('This is a required field.');
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:jonmifsud,项目名称:email_newsletter_manager,代码行数:25,代码来源:field.email_newsletter_manager.php

示例5: checkFields

 /**
  * Checks fields for errors in section editor.
  *
  * @param array $errors
  * @param boolean $checkForDuplicates
  */
 function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     // check if a related section has been selected
     if ($this->get('related_section_id') == '') {
         $errors['related_section_id'] = __('This is a required field.');
     }
     // check if caption content is well formed
     if ($this->get('caption')) {
         $validate = simplexml_load_string('<li>' . $this->get('caption') . '</li>');
         if (!$validate) {
             $errors['caption'] = __('Caption has to be well-formed. Please check opening and closing tags.');
         }
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:bitfyre,项目名称:mediathek,代码行数:24,代码来源:field.mediathek.php

示例6: checkFields

 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_dir(DOCROOT . $this->get('destination') . '/')) {
         $errors['destination'] = __('Directory <code>%s</code> does not exist.', array($this->get('destination')));
     } elseif (!is_writable(DOCROOT . $this->get('destination') . '/')) {
         $errors['destination'] = __('Destination folder, <code>%s</code>, is not writable. Please check permissions.', array($this->get('destination')));
     }
     if ($this->get('maximum_filesize') != NULL && !is_numeric($this->get('maximum_filesize'))) {
         $errors['maximum_filesize'] = __('Invalid value specified. Must be a number.');
     }
     if ($this->get('maximum_dimension_width') != NULL && !is_numeric($this->get('maximum_dimension_width'))) {
         $errors['maximum_dimension_width'] = __('Invalid value specified. Must be a number.');
     }
     if ($this->get('maximum_dimension_height') != NULL && !is_numeric($this->get('maximum_dimension_height'))) {
         $errors['maximum_dimension_height'] = __('Invalid value specified. Must be a number.');
     }
     if ($this->get('resize_long_edge_dimension') != NULL && !is_numeric($this->get('resize_long_edge_dimension'))) {
         $errors['resize_long_edge_dimension'] = __('Invalid value specified. Must be a number.');
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:pointybeard,项目名称:imageuploadfield,代码行数:21,代码来源:field.imageupload.php

示例7: checkFields

 public function checkFields(array &$errors, $checkForDuplicates = true)
 {
     $expression = trim($this->get('expression'));
     if (!empty($expression)) {
         $r = Conditionalizer::parse($expression);
         if (empty($r)) {
             $errors['expression'] = __('Invalid syntax');
         }
     }
     return parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:ahwayakchih,项目名称:conditionalizer,代码行数:11,代码来源:field.conditionalizer.php

示例8: checkFields

 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     if ($this->get('cname') != '' && !preg_match('/([.]+)/i', $this->get('cname'))) {
         $errors['cname'] = __('This is an invalid CNAME. Don\'t include the protocol (http/s).');
     }
     // Check if a related section has been selected
     if ($this->get('bucket') == '') {
         $errors['bucket'] = __('You have not setup your S3 Access keys yet. Please do so <a href="' . SYMPHONY_URL . '/system/preferences/">here</a>.');
     }
     return Field::checkFields($errors, $checkForDuplicates);
 }
开发者ID:jdsimcoe,项目名称:s3upload_field,代码行数:14,代码来源:field.s3upload.php

示例9: checkFields

 /**
  *
  * Validates the field settings before saving it into the field's table
  */
 public function checkFields(array &$errors, $checkForDuplicates)
 {
     parent::checkFields($errors, $checkForDuplicates);
     $field_handles = $this->get('field-handles');
     if (empty($field_handles)) {
         $errors['field-handles'] = __('You must set at least one field handle or * to enable those settings for all fields in this section');
     }
     foreach ($this->prefixes as $key => $prefix) {
         $width = $this->get($prefix . 'width');
         $height = $this->get($prefix . 'height');
         $resize = $this->get($prefix . 'resize');
         $position = $this->get($prefix . 'position');
         if (!empty($width) && (!is_numeric($width) || intval($width) < 0)) {
             $errors[$prefix . 'width'] = __('Width must be a positive integer');
         }
         if (!empty($height) && (!is_numeric($height) || intval($height) < 0)) {
             $errors[$prefix . 'height'] = __('Height must be a positive integer');
         }
         if (!empty($resize) && (!is_numeric($resize) || intval($resize) < 1 || intval($resize) > 3)) {
             $errors[$prefix . 'resize'] = __('Resize must be a positive integer between 1 and 3');
         }
         if (!empty($position) && (!is_numeric($position) || intval($position) < 1 || intval($position) > 9)) {
             $errors[$prefix . 'position'] = __('Position must be a positive integer between 1 and 9');
         }
     }
     return !empty($errors) ? self::__ERROR__ : self::__OK__;
 }
开发者ID:rc1,项目名称:WebAppsWithCmsStartHere,代码行数:31,代码来源:field.image_preview_settings.php

示例10: checkFields

 /**
  * @see http://symphony-cms.com/learn/api/2.3/toolkit/field/#checkFields
  */
 function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     // Check if a related section has been selected
     if ($this->get('subsection_id') == '') {
         $errors['subsection_id'] = __('This is a required field.');
     }
     // Check if caption content is well formed
     if ($this->get('caption')) {
         try {
             simplexml_load_string('<li>' . $this->get('caption') . '</li>');
         } catch (Exception $e) {
             $errors['caption'] = __('%s has to be well-formed. Please check opening and closing tags.', array(__('Caption')));
         }
     }
     // Check if droptext content is well formed
     if ($this->get('droptext')) {
         try {
             simplexml_load_string('<li>' . $this->get('droptext') . '</li>');
         } catch (Exception $e) {
             $errors['droptext'] = __('%s has to be well-formed. Please check opening and closing tags.', array(__('Drop text')));
         }
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:symphonists,项目名称:subsectionmanager,代码行数:30,代码来源:field.subsectionmanager.php

示例11: checkFields

 function checkFields(array &$errors, $checkForDuplicates = true)
 {
     parent::checkFields($errors, $checkForDuplicates);
     if (trim($this->get('xml_location')) === '') {
         $errors['xml_location'] = __('This is a required field.');
     }
     if (trim($this->get('item_xpath')) === '') {
         $errors['item_xpath'] = __('This is a required field.');
     }
     if (trim($this->get('text_xpath')) === '') {
         $errors['text_xpath'] = __('This is a required field.');
     }
     return !empty($errors) ? self::__ERROR__ : self::__OK__;
 }
开发者ID:symphonists,项目名称:xml_selectbox,代码行数:14,代码来源:field.xml_selectbox.php

示例12: checkFields

 function checkFields(&$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     if ($this->get('related_field_id') == '' || $this->get('related_field_id') == 'none') {
         $errors['related_field_id'] = __('A file upload field must be selected.');
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:klaftertief,项目名称:mediathek,代码行数:10,代码来源:field.mediathek.php

示例13: checkFields

 function checkFields(&$errors, $checkForDuplicates = true)
 {
     // check for presence of upload fields
     $section_id = Administration::instance()->Page->_context[1];
     $fields = FieldManager::fetch(NULL, $section_id, 'ASC', 'sortorder', NULL, NULL, sprintf("AND (type IN ('%s'))", implode("', '", $this->supported_upload_fields)));
     if (empty($fields)) {
         $errors['related_field_id'] = __('There is no upload field in this section. You have to save the section with an upload field before you can add an image cropper field.');
     } else {
         // check if a related field has been selected
         if ($this->get('related_field_id') == '') {
             $errors['related_field_id'] = __('This is a required field.');
         }
     }
     // check if ratios content is well formed
     if ($this->get('ratios')) {
         $ratios = explode(',', $this->get('ratios'));
         $ratios = array_map('trim', $ratios);
         foreach ($ratios as $ratio) {
             if (!preg_match('/^(\\d+\\/\\d+|0)$/', $ratio)) {
                 $errors['ratios'] = __('Ratios have to be well formed.');
             }
         }
     }
     // check if min fields are integers
     $min_fields = array('min_width', 'min_height');
     foreach ($min_fields as $field) {
         $i = $this->get($field);
         if ($i != '' && !preg_match('/^\\d+$/', $i)) {
             $errors[$field] = __('This has to be an integer.');
         }
     }
     return parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:klaftertief,项目名称:imagecropper,代码行数:33,代码来源:field.imagecropper.php

示例14: checkFields

 public function checkFields(&$errors, $checkForDuplicates = true)
 {
     $expression = trim($this->get('filter_publish'));
     if ($expression) {
         $r = $this->parseExpression($expression);
         if (empty($r)) {
             $errors['filter_publish'] = __('Invalid expression.');
         }
     }
     return parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:11,代码来源:field.filter.php

示例15: checkFields

 public function checkFields(array &$errors, $checkForDuplicates = true)
 {
     if (!is_array($errors)) {
         $errors = array();
     }
     if ($this->get('static_options') == '' && ($this->get('dynamic_options') == '' || $this->get('dynamic_options') == 'none')) {
         $errors['dynamic_options'] = __('At least one source must be specified, dynamic or static.');
     }
     parent::checkFields($errors, $checkForDuplicates);
 }
开发者ID:readona,项目名称:symphonyno5,代码行数:10,代码来源:field.select.php


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