
Public Member Functions | |
| checkMedia () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| getHeight () | |
| Retrieves height of applet. | |
| getNlogoPath () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| getNlogoURL () | |
| Retrieves URL of applet. | |
| getSize () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| getWidth () | |
| Retrieves width of applet. | |
| setHeight ($oldCM, $height) | |
| Sets the display height of the model. | |
| setWidth ($oldCM, $width) | |
| Sets the display width of the model. | |
| updateFileList () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| uploadApplet ($tmpFile, $fileName, $width, $height) | |
| Uploads the applet into the content module. | |
Protected Member Functions | |
| doCopy () | |
| Creates a copy of the file. | |
| doDelete () | |
| Deletes all the associated netlogo files. | |
| doGetHTML ($params) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| validate () | |
| INSERT BRIEF DESCRIPTION HERE. | |
Private Member Functions | |
| copyFrom ($oldCM) | |
| INSERT BRIEF DESCRIPTION HERE. | |
Each content module stores information about an applet, including a URL to a .nlogo model file on the server. Also stored is the width and height of the applet. getHTML should return valid HTML code to display the applet in a browser.
Definition at line 13 of file SnapContentMediaNetlogoApplet.php5.
| SnapContentMediaNetlogoApplet::checkMedia | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from SnapContent.
Definition at line 291 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::copyFrom | ( | $ | oldCM | ) | [private] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
| $oldCM | [TYPE]: DESCRIPTION |
Definition at line 147 of file SnapContentMediaNetlogoApplet.php5.
References SObject::setError().
Referenced by setHeight(), and setWidth().
| SnapContentMediaNetlogoApplet::doCopy | ( | ) | [protected] |
Creates a copy of the file.
For internal use only.
Reimplemented from SnapContent.
Definition at line 31 of file SnapContentMediaNetlogoApplet.php5.
References SnapContent::copy().
| SnapContentMediaNetlogoApplet::doDelete | ( | ) | [protected] |
Deletes all the associated netlogo files.
For internal use only.
Reimplemented from SnapContent.
Definition at line 18 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::doGetHTML | ( | $ | params | ) | [protected] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
| $params | [TYPE]: DESCRIPTION |
Reimplemented from SnapContent.
Definition at line 67 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::getHeight | ( | ) |
Retrieves height of applet.
This method is useful when you need the height of the applet for embedding into your own HTML when not using the HTML generated by getHTML().
Definition at line 232 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::getNlogoPath | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Definition at line 262 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::getNlogoURL | ( | ) |
Retrieves URL of applet.
This method is useful when you need the URL of the applet file for embedding into your own HTML when not using the HTML generated by getHTML().
Definition at line 247 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::getSize | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Definition at line 277 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::getWidth | ( | ) |
Retrieves width of applet.
This method is useful when you need the width of the applet for embedding into your own HTML when not using the HTML generated by getHTML().
Definition at line 216 of file SnapContentMediaNetlogoApplet.php5.
References validate().
| SnapContentMediaNetlogoApplet::setHeight | ( | $ | oldCM, | |
| $ | height | |||
| ) |
Sets the display height of the model.
The height is stored in the content module and is the applet's width when getHTML is called.
| $oldCM | [SnapContentMediaNetlogoApplet]: the model you want to change the height of | |
| $height | [integer]: new height |
Definition at line 198 of file SnapContentMediaNetlogoApplet.php5.
References copyFrom(), and SObject::setError().
| SnapContentMediaNetlogoApplet::setWidth | ( | $ | oldCM, | |
| $ | width | |||
| ) |
Sets the display width of the model.
The width is stored in the content module and is the applet's width when getHTML is called.
| $oldCM | [SnapContentMediaNetlogoApplet]: the model you want to change the width of | |
| $width | [integer]: new width |
Definition at line 176 of file SnapContentMediaNetlogoApplet.php5.
References copyFrom(), and SObject::setError().
| SnapContentMediaNetlogoApplet::updateFileList | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from SnapContent.
Definition at line 311 of file SnapContentMediaNetlogoApplet.php5.
References SnapDBI::cancelTransaction(), SnapDBI::commitTransaction(), SnapDBI::startTransaction(), and validate().
| SnapContentMediaNetlogoApplet::uploadApplet | ( | $ | tmpFile, | |
| $ | fileName, | |||
| $ | width, | |||
| $ | height | |||
| ) |
Uploads the applet into the content module.
This method requires four parameters. The first parameter specifies the full path to the file to be uploaded. The file, obviously, must be on the server and accessible to the web server user. The next parameter is the original name of the file. This is useful for when the file to be uploaded was uploaded by the user via a POST request. In that case, you can get the first parameter from $_FILES['foo']['tmp_name'] and the second parameter (original file name) from $_FILES['foo']['fileName']. See the code in snap2.2/tk2/editors/TKMediaNetlogoEditor.php5 for more on how to do this effectively/correctly.
The third and fourth parameters are the width and height of the applet respectively. If the values provided are too small, the applet will be cut off. Both parameters must be supplied and must be greater than 0. This method will not delete the original file as specified by $tmpFile (this was the case in earlier versions of Snap2). You need to clean up that file in your code. If there is any code within Snap2 that does not do that, it should be fixed, or else image files will leak.
Most errors related to resizing or creating the subimages will be handled gracefully, but it is still possible that large or strange images could result in PHP running out of memory, or some other bad condition. Call this method with care and warn users appropriate when uploading images.
| $tmpFile | [string]: full path to soruce Netlogo model file file, on this server | |
| $fileName | [string]: original name of file (do not include path) | |
| $width | [integer]: the desired display width of the applet (greater than 0) | |
| $height | [integer]: the desired display height of the applet (greater than 0) |
Definition at line 113 of file SnapContentMediaNetlogoApplet.php5.
References SObject::setError().
| SnapContentMediaNetlogoApplet::validate | ( | ) | [protected] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
Reimplemented from SnapContent.
Definition at line 50 of file SnapContentMediaNetlogoApplet.php5.
References SnapContent::getAll().
Referenced by checkMedia(), doDelete(), doGetHTML(), getHeight(), getNlogoPath(), getNlogoURL(), getSize(), getWidth(), and updateFileList().
1.5.6