Changeset 2593 for trunk/modules/forge
- Timestamp:
- 04/28/08 16:04:22 (2 weeks ago)
- Files:
-
- trunk/modules/forge/libraries/Forge.php (modified) (5 diffs)
- trunk/modules/forge/libraries/Form_Checklist.php (modified) (3 diffs)
- trunk/modules/forge/libraries/Form_Dateselect.php (modified) (1 diff)
- trunk/modules/forge/libraries/Form_Input.php (modified) (8 diffs)
- trunk/modules/forge/libraries/Form_Phonenumber.php (modified) (1 diff)
- trunk/modules/forge/models/user_edit.php (modified) (5 diffs)
- trunk/modules/forge/views/forge_template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/modules/forge/libraries/Forge.php
r2460 r2593 88 88 89 89 // Create the input 90 switch (count($args))90 switch (count($args)) 91 91 { 92 92 case 1: … … 155 155 { 156 156 $status = TRUE; 157 foreach ($this->inputs as $input)157 foreach ($this->inputs as $input) 158 158 { 159 159 if ($input->validate() == FALSE) … … 174 174 { 175 175 $data = array(); 176 foreach (array_merge($this->hidden, $this->inputs) as $input)176 foreach (array_merge($this->hidden, $this->inputs) as $input) 177 177 { 178 178 if (is_object($input->name)) // It's a Forge_Group object (hopefully) … … 251 251 if (is_array($errors) AND ! empty($errors)) 252 252 { 253 foreach ($errors as $error)253 foreach ($errors as $error) 254 254 { 255 255 // Replace the message with the error in the html error string … … 271 271 if ( ! empty($this->hidden)) 272 272 { 273 foreach ($this->hidden as $input)273 foreach ($this->hidden as $input) 274 274 { 275 275 $hidden[$input->name] = $input->value; trunk/modules/forge/libraries/Form_Checklist.php
r2022 r2593 33 33 // Return the currently checked values 34 34 $array = array(); 35 foreach ($this->data['options'] as $id => $opt)35 foreach ($this->data['options'] as $id => $opt) 36 36 { 37 37 // Return the options that are checked … … 56 56 57 57 $checklist = '<ul class="'.arr::remove('class', $base_data).'">'.$nl; 58 foreach (arr::remove('options', $base_data) as $val => $opt)58 foreach (arr::remove('options', $base_data) as $val => $opt) 59 59 { 60 60 // New set of input data … … 77 77 protected function load_value() 78 78 { 79 foreach ($this->data['options'] as $val => $checked)79 foreach ($this->data['options'] as $val => $checked) 80 80 { 81 81 if ($input = $this->input_value($this->data['name'])) trunk/modules/forge/libraries/Form_Dateselect.php
r1923 r2593 66 66 67 67 $input = ''; 68 foreach ($this->parts as $type => $val)68 foreach ($this->parts as $type => $val) 69 69 { 70 70 if (is_int($type)) trunk/modules/forge/libraries/Form_Input.php
r2362 r2593 221 221 } 222 222 223 foreach ($rules as $rule)223 foreach ($rules as $rule) 224 224 { 225 225 if ($action === '-') … … 306 306 307 307 $messages = array(); 308 foreach ($this->errors as $func => $args)308 foreach ($this->errors as $func => $args) 309 309 { 310 310 if (is_string($args)) … … 328 328 { 329 329 // Get the proper i18n entry, very hacky but it works 330 switch ($func)330 switch ($func) 331 331 { 332 332 case 'valid_url': … … 428 428 if ( ! empty($this->rules)) 429 429 { 430 foreach ($this->rules as $rule)430 foreach ($this->rules as $rule) 431 431 { 432 432 if (($offset = strpos($rule, '[')) !== FALSE) … … 456 456 { 457 457 // Manually call up to 2 args for speed 458 switch (count($args))458 switch (count($args)) 459 459 { 460 460 case 1: … … 491 491 if ( ! empty($this->matches)) 492 492 { 493 foreach ($this->matches as $input)493 foreach ($this->matches as $input) 494 494 { 495 495 if ($this->value != $input->value) … … 504 504 if ( ! empty($this->callbacks)) 505 505 { 506 foreach ($this->callbacks as $callback)506 foreach ($this->callbacks as $callback) 507 507 { 508 508 call_user_func($callback, $this); … … 551 551 $this->errors['min_length'] = array($min); 552 552 } 553 elseif ($length > $max)553 elseif ($length > $max) 554 554 { 555 555 $this->errors['max_length'] = array($max); trunk/modules/forge/libraries/Form_Phonenumber.php
r2222 r2593 52 52 53 53 $input = ''; 54 foreach ($this->parts as $type => $val)54 foreach ($this->parts as $type => $val) 55 55 { 56 56 isset($data['value']) OR $data['value'] = ''; trunk/modules/forge/models/user_edit.php
r2580 r2593 36 36 // 37 37 // $options = array(); 38 // foreach ($roles as $role)38 // foreach ($roles as $role) 39 39 // { 40 40 // // Add each role to the options … … 79 79 isset($data['roles']) and $roles = arr::remove('roles', $data); 80 80 81 foreach ($data as $field => $val)81 foreach ($data as $field => $val) 82 82 { 83 83 // Set object data from the form … … 89 89 // if ($new_user) 90 90 // { 91 // foreach ($roles as $role)91 // foreach ($roles as $role) 92 92 // { 93 93 // // Add the user roles … … 97 97 // else 98 98 // { 99 // foreach (array_diff($this->roles, $roles) as $role)99 // foreach (array_diff($this->roles, $roles) as $role) 100 100 // { 101 101 // // Remove roles that were deactivated … … 103 103 // } 104 104 // 105 // foreach (array_diff($roles, $this->roles) as $role)105 // foreach (array_diff($roles, $this->roles) as $role) 106 106 // { 107 107 // // Add new roles trunk/modules/forge/views/forge_template.php
r2027 r2593 5 5 <?php endif ?> 6 6 <?php 7 foreach ($inputs as $input):7 foreach ($inputs as $input): 8 8 9 9 $sub_inputs = array(); … … 31 31 endif; 32 32 33 foreach ($sub_inputs as $input):33 foreach ($sub_inputs as $input): 34 34 35 35 ?>
