Changeset 12604
- Timestamp:
- 09/30/07 16:56:06 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.datamanager2/formmanager.php
r11955 r12604 209 209 $this->namespace = "{$name}_"; 210 210 211 $this->form = new HTML_QuickForm($name, 'post', '', '_self', Array('id' => $name), true);211 $this->form = new HTML_QuickForm($name, 'post', $_SERVER['REQUEST_URI'], '_self', Array('id' => $name), true); 212 212 $defaults = Array(); 213 213 $this->widgets = Array(); trunk/midcom/midcom.helper.datamanager2/widget/video.php
r11749 r12604 210 210 'id' => "{$this->_namespace}{$this->name}_upload_button", 211 211 ); 212 $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload", $this->_l10n->get('upload file'), $attributes);212 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload", $this->_l10n->get('upload file'), $attributes); 213 213 214 214 // Add Title line if configured to do so … … 355 355 'id' => "{$this->_namespace}{$this->name}_upload_button", 356 356 ); 357 $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload", $this->_l10n->get('upload file'), $attributes);357 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload", $this->_l10n->get('upload file'), $attributes); 358 358 359 359 // Add Title line if configured to do so. … … 403 403 'id' => "{$this->_namespace}{$this->name}_upload_button_video", 404 404 ); 405 $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes);405 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 406 406 407 407 $static_html = "</td></tr>\n"; … … 454 454 'id' => "{$this->_namespace}{$this->name}_upload_button_video", 455 455 ); 456 $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes);456 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 457 457 458 458 $static_html = "</td></tr>"; … … 570 570 } 571 571 572 } 573 elseif ($this->_upload_element_video->isUploadedFile()) 574 {575 576 $file_video = $this->_upload_element_video->getValue();577 578 echo "<pre>";579 //print_r($this->_upload_element_video); 580 //print_r($this->_upload_element);581 echo "</pre>";582 583 if (!empty($file_video['name'])) 584 { 585 if (! $this->_type->set_video($file_video['name'], $file_video['tmp_name'], 'Video file'))572 } 573 else 574 { 575 if ($this->_upload_element_video->isUploadedFile()) 576 { 577 578 $file_video = $this->_upload_element_video->getValue(); 579 580 //echo "<pre>"; 581 //print_r($this->_upload_element_video); 582 //print_r($this->_upload_element); 583 //echo "</pre>"; 584 585 if (!empty($file_video['name'])) 586 586 { 587 debug_push_class(__CLASS__, __FUNCTION__); 588 debug_add("Failed to process image {$this->name}.", MIDCOM_LOG_INFO); 589 debug_pop(); 590 $this->_cast_formgroup_to_upload_video(); 587 if (! $this->_type->set_video($file_video['name'], $file_video['tmp_name'], 'Video file')) 588 { 589 debug_push_class(__CLASS__, __FUNCTION__); 590 debug_add("Failed to process image {$this->name}.", MIDCOM_LOG_INFO); 591 debug_pop(); 592 $this->_cast_formgroup_to_upload_video(); 593 } 594 else 595 { 596 $this->_cast_formgroup_to_replacedelete_video(); 597 } 591 598 } 592 else593 {594 $this->_cast_formgroup_to_replacedelete_video();595 }596 }597 598 }599 elseif ($this->_upload_element->isUploadedFile())600 {601 $file = $this->_upload_element->getValue();602 603 echo "<pre>";604 //print_r($this->_upload_element_video);605 //print_r($this->_upload_element);606 echo "</pre>";607 608 609 if ($this->show_title)610 {611 $title = $results["{$this->name}_title"];612 }613 else614 {615 $title = '';616 599 } 617 600 618 if (!empty($file['name'])) 619 { 620 if (! $this->_type->set_image($file['name'], $file['tmp_name'], $title)) 601 if ($this->_upload_element->isUploadedFile()) 602 { 603 $file = $this->_upload_element->getValue(); 604 605 //echo "<pre>"; 606 //print_r($this->_upload_element_video); 607 //print_r($this->_upload_element); 608 //echo "</pre>"; 609 610 if ($this->show_title) 621 611 { 622 debug_push_class(__CLASS__, __FUNCTION__); 623 debug_add("Failed to process image {$this->name}.", MIDCOM_LOG_INFO); 624 debug_pop(); 625 $this->_cast_formgroup_to_upload(); 612 $title = $results["{$this->name}_title"]; 626 613 } 627 614 else 628 615 { 629 $t his->_cast_formgroup_to_replacedelete();616 $title = ''; 630 617 } 631 } 618 619 if (!empty($file['name'])) 620 { 621 if (! $this->_type->set_image($file['name'], $file['tmp_name'], $title)) 622 { 623 debug_push_class(__CLASS__, __FUNCTION__); 624 debug_add("Failed to process image {$this->name}.", MIDCOM_LOG_INFO); 625 debug_pop(); 626 $this->_cast_formgroup_to_upload(); 627 } 628 else 629 { 630 $this->_cast_formgroup_to_replacedelete(); 631 } 632 } 633 } 632 634 } 633 635 }
