Esempio n. 1
0
 public static function GetInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Esempio n. 2
0
 /**
  * @param string the URL to the long description of the image.
  */
 public function setDescriptionUrl($value)
 {
     parent::setDescriptionUrl($value);
     if ($this->getActiveControl()->canUpdateClientSide()) {
         $this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value);
     }
 }
Esempio n. 3
0
 /**
  * Renders this imagemap.
  * @param THtmlWriter
  */
 public function render($writer)
 {
     parent::render($writer);
     $hotspots = $this->getHotSpots();
     if ($hotspots->getCount() > 0) {
         $clientID = $this->getClientID();
         $cs = $this->getPage()->getClientScript();
         $writer->writeLine();
         $writer->addAttribute('name', self::MAP_NAME_PREFIX . $clientID);
         $writer->renderBeginTag('map');
         $writer->writeLine();
         if (($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet) {
             $mode = THotSpotMode::Navigate;
         }
         $target = $this->getTarget();
         $i = 0;
         $options['EventTarget'] = $this->getUniqueID();
         $options['StopEvent'] = true;
         $cs = $this->getPage()->getClientScript();
         foreach ($hotspots as $hotspot) {
             if ($hotspot->getHotSpotMode() === THotSpotMode::NotSet) {
                 $hotspot->setHotSpotMode($mode);
             }
             if ($target !== '' && $hotspot->getTarget() === '') {
                 $hotspot->setTarget($target);
             }
             if ($hotspot->getHotSpotMode() === THotSpotMode::PostBack) {
                 $id = $clientID . '_' . $i;
                 $writer->addAttribute('id', $id);
                 $writer->addAttribute('href', '#' . $id);
                 //create unique no-op url references
                 $options['ID'] = $id;
                 $options['EventParameter'] = "{$i}";
                 $options['CausesValidation'] = $hotspot->getCausesValidation();
                 $options['ValidationGroup'] = $hotspot->getValidationGroup();
                 $cs->registerPostBackControl($this->getClientClassName(), $options);
             }
             $hotspot->render($writer);
             $writer->writeLine();
             $i++;
         }
         $writer->renderEndTag();
     }
 }
Esempio n. 4
0
    }
    echo '<td>' . $field->description . '</td>';
    echo '<td>$ ' . $field->price . '</td>';
    echo '</tr>';
}
?>
<!-- fields -->
<!-- image 
<tr>
	<td><?php 
echo JText::_('Pictures');
?>
</td>
	<td id="uploader_td">
	<?php 
echo TImage::displayImageUploader($this->conf, $this->content, $this->adext);
?>
	<?php 
if (PAIDSYSTEM) {
    $paidconfig = getPaidSystemConfig();
    if (isset($paidconfig->enable_image_pack) && $paidconfig->enable_image_pack == 1) {
        ?>
		<input type="checkbox" id="images_pack" value="1" <?php 
        if (@$this->adext->images == 1) {
            echo "checked";
        }
        ?>
 name="images_pack" />
		<span class="option_photo"><?php 
        echo sprintf(JText::_('PAIDSYSTEM_IMAGE_PACK_NB_IMAGES'), $paidconfig->num_images, getPrice($paidconfig->image_price));
        ?>
<?php

// inclui as classes necessárias
include_once 'app.widgets/TElement.class.php';
include_once 'app.widgets/TImage.class.php';
// instancia objeto imagem
$gnome = new TImage('app.images/gnome.png');
// exibe objeto imagem
$gnome->show();
// instancia objeto imagem
$gimp = new TImage('app.images/gimp.png');
// exibe objeto imagem
$gimp->show();
Esempio n. 6
0
 /**
  * Registers the image button to receive postback data during postback.
  * This is necessary because an image button, when postback, does not have
  * direct mapping between post data and the image button name.
  * This method overrides the parent implementation and is invoked before render.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->getPage()->registerRequiresPostData($this);
 }
Esempio n. 7
0
 /**
  * Возвращает фото публикации
  * @param array $size
  * @param string $resize_method
  * @return string
  */
 function getImage($size = array(), $resize_method = 'adaptiveResize')
 {
     $image = $this->_data['image'];
     if ($size && $image) {
         if ($image[0] == '/') {
             $image = substr($image, 1);
         }
         $realSize = getimagesize($image);
         if (!$realSize) {
             $image = $this->_data['image'];
         } else {
             if (isset($size[0]) && $realSize[0] > $size[0] || isset($size[1]) && $realSize[1] > $size[1]) {
                 include_once "phpThumb/image.class.php";
                 try {
                     $image = TImage::thumb($size[0], $size[1], '/' . $image, array('method' => $resize_method));
                 } catch (Exception $e) {
                     $image = $this->_data['image'];
                 }
             } else {
                 $image = $this->_data['image'];
             }
         }
     }
     return $image;
 }
Esempio n. 8
0
			errorMSG += <?php echo json_encode(JText::_('ADSMANAGER_FORM_CATEGORY')); ?>+" : "+<?php echo json_encode(JText::_('ADSMANAGER_REGWARN_ERROR')); ?>+'\n';
			srcList.style.background = "#B94A48";
			iserror=1;
		}
		else
		{
			for (var i=0; i < srcLen; i++) {
				srcList.options[i].selected = true;
			}
		}
	<?php
	}
	?>
	
	<?php
	TImage::displayImageUploaderFormChecker();
	?>
	
	if(iserror==1) {
		return false;
	} else {

	        
		//Little hack to be able to return the selected_cats
		<?php if ($this->nbcats > 1) { ?>
			srcList.name = "selected_cats[]"; 
		<?php } ?>
		return true;
	}
}
Esempio n. 9
0
 /**
  * Configures the image URL that shows the token.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if (!self::checkRequirements()) {
         throw new TConfigurationException('captcha_imagettftext_required');
     }
     if (!$this->getViewState('TokenGenerated', 0)) {
         $manager = $this->getApplication()->getAssetManager();
         $manager->publishFilePath($this->getFontFile());
         $url = $manager->publishFilePath($this->getCaptchaScriptFile());
         $url .= '?options=' . urlencode($this->getTokenImageOptions());
         $this->setImageUrl($url);
         $this->setViewState('TokenGenerated', time());
     }
 }
 /**
  * This overrides the parent implementation by rendering more TImageButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['name'] = $this->getUniqueID();
     $attributes['type'] = 'image';
     if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
         $script = "Prado.Validation.AddTarget('{$this->ClientID}');";
         $this->Page->registerEndScript($this->ClientID . 'target', $script);
     }
     return $attributes;
 }