示例#1
0
文件: Hash.php 项目: ariol/adminshop
 public function get_submitted_value()
 {
     $source = $this->get_value_source();
     $values = array();
     foreach ($source as $field_name => $field_value) {
         if (strpos($field_name, $this->get_name() . '_') === 0) {
             $num = str_replace($this->get_name() . '_', '', $field_name);
             // Нашли поле, отвечающее за имя
             if (preg_match('#^[0-9]+$#', $num)) {
                 $namefield = new CM_Field_String();
                 $namefield->set_name($field_name);
                 $namefield->set_value_source($this->get_value_source());
                 $name = $namefield->get_submitted_value()->get_raw();
                 $valuefield = clone $this->get_value_field();
                 $value = arr::get(array_values($this->get_value()->get_values()), $num);
                 if ($value) {
                     $value = $value->get_raw();
                 }
                 $valuefield->set_raw_value($value);
                 $valuefield->set_name($field_name . '_value');
                 $valuefield->set_value_source($this->get_value_source());
                 $values[$name] = $valuefield->get_submitted_value()->get_raw();
             }
         }
     }
     return $this->create_raw_value(serialize($values));
 }
示例#2
0
文件: Phone.php 项目: ariol/adminshop
 protected function validate()
 {
     parent::validate();
     if (!preg_match('#^[ 0-9\\+\\-\\(\\)]+$#', $this->get_value()->get_raw())) {
         $this->set_error('Телефон может содержать только цифры, скобки, пробелы, - и +');
     }
 }
示例#3
0
文件: hash.php 项目: ariol/adminshop
    echo $name;
    ?>
_next_field_num = <?php 
    echo $i;
    ?>
;
//-->
</script>
	</td>
</tr>
<?php 
}
?>
</tbody>
<?php 
$field_name = new CM_Field_String();
$field_name->set_name($name . '___i__');
$value_field->set_name($name . '___i___value');
if ($allow_add) {
    ?>
<tr style="display: none;" id="<?php 
    echo $name;
    ?>
_field_new">
	<td>
<?php 
    echo $field_name->render();
    ?>
	</td>
	<td>
<?php 
示例#4
0
文件: Text.php 项目: ariol/adminshop
 public function __construct()
 {
     parent::__construct();
 }