Changeset 2434
- Timestamp:
- 04/18/2008 04:47:05 AM
- Files:
-
- trunk/framework/Web/UI/ActiveControls/TCallbackClientScript.php (modified) (33 diffs)
- trunk/framework/Web/UI/TControl.php (modified) (1 diff)
- trunk/framework/Web/UI/WebControls/TCheckBox.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/framework/Web/UI/ActiveControls/TCallbackClientScript.php
r2425 r2434 165 165 public function setAttribute($control, $name, $value) 166 166 { 167 if ($control instanceof I ControlContainer)168 $control=$control->get ContainerClientID();167 if ($control instanceof ISurroundable) 168 $control=$control->getSurroundingTagID(); 169 169 $this->callClientFunction('Prado.Element.setAttribute',array($control, $name, $value)); 170 170 } … … 194 194 public function show($element) 195 195 { 196 if ($element instanceof I ControlContainer)197 $element=$element->get ContainerClientID();196 if ($element instanceof ISurroundable) 197 $element=$element->getSurroundingTagID(); 198 198 $this->callClientFunction('Element.show', $element); 199 199 } … … 205 205 public function hide($element) 206 206 { 207 if ($element instanceof I ControlContainer)208 $element=$element->get ContainerClientID();207 if ($element instanceof ISurroundable) 208 $element=$element->getSurroundingTagID(); 209 209 $this->callClientFunction('Element.hide', $element); 210 210 } … … 218 218 public function toggle($element, $effect=null, $options=array()) 219 219 { 220 if ($element instanceof I ControlContainer)221 $element=$element->get ContainerClientID();220 if ($element instanceof ISurroundable) 221 $element=$element->getSurroundingTagID(); 222 222 $this->callClientFunction('Element.toggle', array($element,$effect,$options)); 223 223 } … … 229 229 public function remove($element) 230 230 { 231 if ($element instanceof I ControlContainer)232 $element=$element->get ContainerClientID();231 if ($element instanceof ISurroundable) 232 $element=$element->getSurroundingTagID(); 233 233 $this->callClientFunction('Element.remove', $element); 234 234 } … … 247 247 public function update($element, $content) 248 248 { 249 if ($element instanceof I ControlContainer)250 $element=$element->get ContainerClientID();249 if ($element instanceof ISurroundable) 250 $element=$element->getSurroundingTagID(); 251 251 $this->replace($element, $content, 'Element.update'); 252 252 } … … 259 259 public function addCssClass($element, $cssClass) 260 260 { 261 if ($element instanceof I ControlContainer)262 $element=$element->get ContainerClientID();261 if ($element instanceof ISurroundable) 262 $element=$element->getSurroundingTagID(); 263 263 $this->callClientFunction('Element.addClassName', array($element, $cssClass)); 264 264 } … … 271 271 public function removeCssClass($element, $cssClass) 272 272 { 273 if ($element instanceof I ControlContainer)274 $element=$element->get ContainerClientID();273 if ($element instanceof ISurroundable) 274 $element=$element->getSurroundingTagID(); 275 275 $this->callClientFunction('Element.removeClassName', array($element, $cssClass)); 276 276 } … … 293 293 public function scrollTo($element) 294 294 { 295 if ($element instanceof I ControlContainer)296 $element=$element->get ContainerClientID();295 if ($element instanceof ISurroundable) 296 $element=$element->getSurroundingTagID(); 297 297 $this->callClientFunction('Element.scrollTo', $element); 298 298 } … … 315 315 public function setStyle($element, $styles) 316 316 { 317 if ($element instanceof I ControlContainer)318 $element=$element->get ContainerClientID();317 if ($element instanceof ISurroundable) 318 $element=$element->getSurroundingTagID(); 319 319 $this->callClientFunction('Prado.Element.setStyle', array($element, $styles)); 320 320 } … … 327 327 public function appendContent($element, $content) 328 328 { 329 if ($element instanceof I ControlContainer)330 $element=$element->get ContainerClientID();329 if ($element instanceof ISurroundable) 330 $element=$element->getSurroundingTagID(); 331 331 $this->replace($element, $content, 'Prado.Element.Insert.append'); 332 332 } … … 339 339 public function prependContent($element, $content) 340 340 { 341 if ($element instanceof I ControlContainer)342 $element=$element->get ContainerClientID();341 if ($element instanceof ISurroundable) 342 $element=$element->getSurroundingTagID(); 343 343 $this->replace($element, $content, 'Prado.Element.Insert.prepend'); 344 344 } … … 351 351 public function insertContentAfter($element, $content) 352 352 { 353 if ($element instanceof I ControlContainer)354 $element=$element->get ContainerClientID();353 if ($element instanceof ISurroundable) 354 $element=$element->getSurroundingTagID(); 355 355 $this->replace($element, $content, 'Prado.Element.Insert.after'); 356 356 } … … 363 363 public function insertContentBefore($element, $content) 364 364 { 365 if ($element instanceof I ControlContainer)366 $element=$element->get ContainerClientID();365 if ($element instanceof ISurroundable) 366 $element=$element->getSurroundingTagID(); 367 367 $this->replace($element, $content, 'Prado.Element.Insert.before'); 368 368 } … … 407 407 public function replaceContent($element,$content) 408 408 { 409 if ($element instanceof I ControlContainer)410 $element=$element->get ContainerClientID();409 if ($element instanceof ISurroundable) 410 $element=$element->getSurroundingTagID(); 411 411 $this->replace($element, $content); 412 412 } … … 459 459 public function visualEffect($type, $element, $options=null) 460 460 { 461 if ($element instanceof I ControlContainer)462 $element=$element->get ContainerClientID();461 if ($element instanceof ISurroundable) 462 $element=$element->getSurroundingTagID(); 463 463 $this->callClientFunction($type, array($element, $options)); 464 464 } … … 471 471 public function appear($element, $options=null) 472 472 { 473 if ($element instanceof I ControlContainer)474 $element=$element->get ContainerClientID();473 if ($element instanceof ISurroundable) 474 $element=$element->getSurroundingTagID(); 475 475 $this->visualEffect('Effect.Appear', $element, $options); 476 476 } … … 483 483 public function blindDown($element, $options=null) 484 484 { 485 if ($element instanceof I ControlContainer)486 $element=$element->get ContainerClientID();485 if ($element instanceof ISurroundable) 486 $element=$element->getSurroundingTagID(); 487 487 $this->visualEffect('Effect.BlindDown', $element, $options); 488 488 } … … 495 495 public function blindUp($element, $options=null) 496 496 { 497 if ($element instanceof I ControlContainer)498 $element=$element->get ContainerClientID();497 if ($element instanceof ISurroundable) 498 $element=$element->getSurroundingTagID(); 499 499 $this->visualEffect('Effect.BlindUp', $element, $options); 500 500 … … 508 508 public function dropOut($element, $options=null) 509 509 { 510 if ($element instanceof I ControlContainer)511 $element=$element->get ContainerClientID();510 if ($element instanceof ISurroundable) 511 $element=$element->getSurroundingTagID(); 512 512 $this->visualEffect('Effect.DropOut', $element, $options); 513 513 } … … 520 520 public function fade($element, $options=null) 521 521 { 522 if ($element instanceof I ControlContainer)523 $element=$element->get ContainerClientID();522 if ($element instanceof ISurroundable) 523 $element=$element->getSurroundingTagID(); 524 524 $this->visualEffect('Effect.Fade', $element, $options); 525 525 } … … 532 532 public function fold($element, $options = null) 533 533 { 534 if ($element instanceof I ControlContainer)535 $element=$element->get ContainerClientID();534 if ($element instanceof ISurroundable) 535 $element=$element->getSurroundingTagID(); 536 536 $this->visualEffect('Effect.Fold', $element, $options); 537 537 } … … 544 544 public function grow($element, $options=null) 545 545 { 546 if ($element instanceof I ControlContainer)547 $element=$element->get ContainerClientID();546 if ($element instanceof ISurroundable) 547 $element=$element->getSurroundingTagID(); 548 548 $this->visualEffect('Effect.Grow', $element, $options); 549 549 } … … 556 556 public function puff($element, $options=null) 557 557 { 558 if ($element instanceof I ControlContainer)559 $element=$element->get ContainerClientID();558 if ($element instanceof ISurroundable) 559 $element=$element->getSurroundingTagID(); 560 560 $this->visualEffect('Effect.Puff', $element, $options); 561 561 } … … 568 568 public function pulsate($element, $options=null) 569 569 { 570 if ($element instanceof I ControlContainer)571 $element=$element->get ContainerClientID();570 if ($element instanceof ISurroundable) 571 $element=$element->getSurroundingTagID(); 572 572 $this->visualEffect('Effect.Pulsate', $element, $options); 573 573 } … … 580 580 public function shake($element, $options=null) 581 581 { 582 if ($element instanceof I ControlContainer)583 $element=$element->get ContainerClientID();582 if ($element instanceof ISurroundable) 583 $element=$element->getSurroundingTagID(); 584 584 $this->visualEffect('Effect.Shake', $element, $options); 585 585 } … … 592 592 public function shrink($element, $options=null) 593 593 { 594 if ($element instanceof I ControlContainer)595 $element=$element->get ContainerClientID();594 if ($element instanceof ISurroundable) 595 $element=$element->getSurroundingTagID(); 596 596 $this->visualEffect('Effect.Shrink', $element, $options); 597 597 } … … 604 604 public function slideDown($element, $options=null) 605 605 { 606 if ($element instanceof I ControlContainer)607 $element=$element->get ContainerClientID();606 if ($element instanceof ISurroundable) 607 $element=$element->getSurroundingTagID(); 608 608 $this->visualEffect('Effect.SlideDown', $element, $options); 609 609 } … … 616 616 public function slideUp($element, $options=null) 617 617 { 618 if ($element instanceof I ControlContainer)619 $element=$element->get ContainerClientID();618 if ($element instanceof ISurroundable) 619 $element=$element->getSurroundingTagID(); 620 620 $this->visualEffect('Effect.SlideUp', $element, $options); 621 621 } … … 628 628 public function squish($element, $options=null) 629 629 { 630 if ($element instanceof I ControlContainer)631 $element=$element->get ContainerClientID();630 if ($element instanceof ISurroundable) 631 $element=$element->getSurroundingTagID(); 632 632 $this->visualEffect('Effect.Squish', $element, $options); 633 633 } … … 640 640 public function switchOff($element, $options=null) 641 641 { 642 if ($element instanceof I ControlContainer)643 $element=$element->get ContainerClientID();642 if ($element instanceof ISurroundable) 643 $element=$element->getSurroundingTagID(); 644 644 $this->visualEffect('Effect.SwitchOff', $element, $options); 645 645 } … … 652 652 public function highlight($element, $options=null) 653 653 { 654 if ($element instanceof I ControlContainer)655 $element=$element->get ContainerClientID();654 if ($element instanceof ISurroundable) 655 $element=$element->getSurroundingTagID(); 656 656 $this->visualEffect('Prado.Effect.Highlight', $element, $options); 657 657 } … … 664 664 public function setOpacity($element, $value) 665 665 { 666 if ($element instanceof I ControlContainer)667 $element=$element->get ContainerClientID();666 if ($element instanceof ISurroundable) 667 $element=$element->getSurroundingTagID(); 668 668 $value = TPropertyValue::ensureFloat($value); 669 669 $this->callClientFunction('Element.setOpacity', array($element,$value)); trunk/framework/Web/UI/TControl.php
r2424 r2434 2153 2153 2154 2154 /** 2155 * IControlContainer interface 2156 * 2157 * If a control can have an additional surrounding tag, it should implement this interface. 2155 * ISurroundable interface 2156 * 2157 * Identifies controls that may create an additional surrounding tag. The id of the 2158 * tag can be obtained with {@link getSurroundingTagID}. 2158 2159 * 2159 2160 * @package System.Web.UI 2160 2161 * @since 3.1.2 2161 2162 */ 2162 interface I ControlContainer2163 interface ISurroundable 2163 2164 { 2164 2165 /** 2165 * @return string the id of the container html tag or of the input control itself if no container present.2166 */ 2167 public function get ContainerClientID();2166 * @return string the id of the embedding tag of the control or the control's clientID if not surrounded 2167 */ 2168 public function getSurroundingTagID(); 2168 2169 } 2169 2170 trunk/framework/Web/UI/WebControls/TCheckBox.php
r2424 r2434 41 41 * @since 3.0 42 42 */ 43 class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer, I ControlContainer43 class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer, ISurroundable 44 44 { 45 45 private $_dataChanged=false; … … 269 269 270 270 /** 271 * @return string the id of the surrounding tag or this clientID if no such tag present272 */ 273 public function get ContainerClientID()271 * @return string the id of the surrounding tag or this clientID if no such tag needed 272 */ 273 public function getSurroundingTagID() 274 274 { 275 275 return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID(); … … 305 305 if($needspan=$this->getSpanNeeded()) 306 306 { 307 $writer->addAttribute('id',$this->get ContainerClientID());307 $writer->addAttribute('id',$this->getSurroundingTagID()); 308 308 $writer->renderBeginTag('span'); 309 309 }
