[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sitemanager-devel
Subject:    pictureUpload module and pictureEntity.inc
From:       "Mike Wright" <info () europoly ! net>
Date:       2002-08-23 8:42:53
[Download RAW message or body]

Hi,

Here are
pictureUpload module
(a module for uploading, copying, resizing, adding effects to, etc.
pictures,
This has one eefct in "dropShadow" which I haven't included the code for,
simply because I so embarrassed about how bad it is and I haven't found the
time to improve it yet...).

and pictureEntity.inc
(combined "show picture", fileSelect and a puLink to, probably, a page which
uses pictureUpload.).

The last may require some cahnges to other files (as described in the file).

Maybe it's useful.

Mike Wright


["pictureEntity.inc" (text/plain)]

<?php
/*********************************************************************
*  Roadsend SiteManager
*  Copyright (c) 2001,2002 Roadsend, Inc.(http://www.roadsend.com)
**********************************************************************
*
* This source file is subject to version 1.0 of the Roadsend Public
* License, that is bundled with this package in the file 
* LICENSE, and is available through the world wide web at 
* http://www.roadsend.com/license/rpl1.txt
*
**********************************************************************
* Author(s): Shannon Weyrick (weyrick@roadsend.com)
* Mike Wright, www.europoly.net
*/

/**
 * Group of input entities: 
 *  - shows picture if values are set for location and name of picture
 *  - drop down list from file select to select a picture from a directory
 * - a pop link to a window for uploading files (works well with pictureUpload.Mod)
*
 * This entity requires these changes:
 * sfFormEnity.inc 170 
*
*	$this->inputEntity->preEntityThink();
*      $this->inputEntity->entityThink();
*      $this->inputEntity->postEntityThink();
*
*sfInputEntities.inc 321 
*
*   function preEntityThink() {    
*        // virtual
*    }
*    function entityThink() {   
*        // virtual   
*    }
*    function postEntityThink() {  
*        // virtual  
*    }
*
*/
 SM_sfLoadEntity('fileSelect');      // load  parent

class pictureEntity extends fileSelectEntity {

	var $value;
    /** setup entity */
    function entityConfig() {
            parent::entityConfig();

        // setup some defaults
        $this->directive['rootDir']         = '/_invalid_';
        $this->directive['httpdRootDir']         = '/_invalid_';
        $this->directive['cellClass']     = 'body';
        $this->directive['linkClass']     = 'box2';
        $this->directive['pictureCellClass']     = 'body';
        $this->directive['type'];	// can set type of picture (determines \
                sub-directory in pictureUpload.mod)
        $this->addDirective('puLink','upload.php');		// name of file to open in pop \
                up
        $this->addDirective('puScrollBars','no');		// show scroll bars in pop up \
window - yes or no  $this->addDirective('linkText','Bild Uploaden');
        $this->addDirective('puWidth','500');
        $this->addDirective('puHeight','270');
    }
    function preEntityThink() {
		$this->say('<table width=100%"><tr><td align="left" \
class="'.$this->directive['pictureCellClass'].'">');  if(isset($this->value)){
			$imageSize=getImageSize($this->directive['httpdRootDir'].$this->value);
			if($imageSize[2]){$this->say("<IMG name=\"$this->varName\" \
src=\"".$this->directive['httpdRootDir'].$this->value."\".$imageSize[2] ><br>");}  }
    }
    function postEntityThink() {
		$this->say('</td></tr><tr><td \
class="'.$this->directive['cellClass'].'">&nbsp;&nbsp;&nbsp;');  \
$this->say($this->sessionH->puLink($this->directive['puLink'].'?dir='.$this->directive \
['type'],$this->directive['linkText'],$this->directive['puWidth'],$this->directive['puHeight'],$this->directive['linkClass'],$this->directive['puScrollBars']));
  $this->say('</td></tr></table>');
    
    }
}

?>


["pictureUpload.mod" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic