Public Member Functions | |
checkMedia () | |
INSERT BRIEF DESCRIPTION HERE. | |
getAdditionalWorksheets () | |
INSERT BRIEF DESCRIPTION HERE. | |
getAppDirPath () | |
INSERT BRIEF DESCRIPTION HERE. | |
getAppDirURL () | |
Retrieves a functioning URL to the directory in which the applet resides. | |
getHeight () | |
Retrieves height of applet. | |
getSize () | |
INSERT BRIEF DESCRIPTION HERE. | |
getWidth () | |
Retrieves width of applet. | |
getWorksheet () | |
Retrieves filename of the default worksheet. | |
getWsCols () | |
Retrieves number of columns of the default worksheet. | |
getWsRows () | |
Retrieves number of rows of the default worksheet. | |
getZipPath () | |
INSERT BRIEF DESCRIPTION HERE. | |
getZipURL () | |
INSERT BRIEF DESCRIPTION HERE. | |
setAdditionalWorksheets ($oldCM, $addl) | |
INSERT BRIEF DESCRIPTION HERE. | |
setHeight ($oldCM, $height) | |
Sets the display height of the model. | |
setWidth ($oldCM, $width) | |
Sets the display width of the model. | |
setWorksheet ($oldCM, $worksheet) | |
Sets the name of the default worksheet. It should be the name of a file that was included in the ZIP file passed to uploadApplet. | |
setWsCols ($oldCM, $wsCols) | |
Sets the number of columns to display of the default worksheet. | |
setWsRows ($oldCM, $wsRows) | |
Sets the number of rows to display of the default worksheet. | |
updateFileList () | |
INSERT BRIEF DESCRIPTION HERE. | |
uploadApplet ($tmpFile, $fileName, $width, $height, $wsCols, $wsRows, $worksheet, $addlWorksheets=array()) | |
Uploads the applet into the content module. |
Each content module stores information about an AgentSheets applet, including a URL to an AgentSheets project folder on the server. Note that the content module does not yet support sound effects in AgentSheet models. A number of other attributes are stored, including the width and height in pixels of the applet, the number of columns and rows held in the default worksheet, a link to the worksheet, and a number of properties selected while * inside the Ristretto tool in AgentSheets. getHTML should return valid HTML code to display the applet in a browser.
SnapContentMediaAgentsheetsApplet::checkMedia | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from SnapContent.
SnapContentMediaAgentsheetsApplet::getAdditionalWorksheets | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
SnapContentMediaAgentsheetsApplet::getAppDirPath | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
SnapContentMediaAgentsheetsApplet::getAppDirURL | ( | ) |
Retrieves a functioning URL to the directory in which the applet resides.
This method is useful when you need information about the applet for embedding into your own HTML when not using the HTML generated by getHTML().
SnapContentMediaAgentsheetsApplet::getHeight | ( | ) |
Retrieves height of applet.
This method is useful when you need information about applet for embedding into your own HTML when not using the HTML generated by getHTML().
SnapContentMediaAgentsheetsApplet::getSize | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
SnapContentMediaAgentsheetsApplet::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().
SnapContentMediaAgentsheetsApplet::getWorksheet | ( | ) |
Retrieves filename of the default worksheet.
This method is useful when you need information about the applet for embedding into your own HTML when not using the HTML generated by getHTML().
SnapContentMediaAgentsheetsApplet::getWsCols | ( | ) |
Retrieves number of columns of the default worksheet.
This method is useful when you need information about the applet for embedding into your own HTML when not using the HTML generated by getHTML().
SnapContentMediaAgentsheetsApplet::getWsRows | ( | ) |
Retrieves number of rows of the default worksheet.
This method is useful when you need information about the applet for embedding into your own HTML when not using the HTML generated by getHTML().
SnapContentMediaAgentsheetsApplet::getZipPath | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
SnapContentMediaAgentsheetsApplet::getZipURL | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
SnapContentMediaAgentsheetsApplet::setAdditionalWorksheets | ( | $ | oldCM, | |
$ | addl | |||
) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$oldCM | [TYPE]: DESCRIPTION | |
$addl | [TYPE]: DESCRIPTION |
SnapContentMediaAgentsheetsApplet::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 |
SnapContentMediaAgentsheetsApplet::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 |
SnapContentMediaAgentsheetsApplet::setWorksheet | ( | $ | oldCM, | |
$ | worksheet | |||
) |
Sets the name of the default worksheet. It should be the name of a file that was included in the ZIP file passed to uploadApplet.
If the worksheet has more than this number of rows, the other rows will not be displayed.
$oldCM | [SnapContentMediaNetlogoApplet]: the model you want to set the default worksheet for. | |
$worksheet | [integer]: new rows |
SnapContentMediaAgentsheetsApplet::setWsCols | ( | $ | oldCM, | |
$ | wsCols | |||
) |
Sets the number of columns to display of the default worksheet.
If the worksheet has more than this number of rows, the other rows will not be displayed.
$oldCM | [SnapContentMediaNetlogoApplet]: the model you want to change the wsCols of | |
$wsCols | [integer]: new rows |
SnapContentMediaAgentsheetsApplet::setWsRows | ( | $ | oldCM, | |
$ | wsRows | |||
) |
Sets the number of rows to display of the default worksheet.
If the worksheet has more than this number of rows, the other rows will not be displayed.
$oldCM | [SnapContentMediaNetlogoApplet]: the model you want to change the wsRows of | |
$wsRows | [integer]: new rows |
SnapContentMediaAgentsheetsApplet::updateFileList | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from SnapContent.
SnapContentMediaAgentsheetsApplet::uploadApplet | ( | $ | tmpFile, | |
$ | fileName, | |||
$ | width, | |||
$ | height, | |||
$ | wsCols, | |||
$ | wsRows, | |||
$ | worksheet, | |||
$ | addlWorksheets = array() | |||
) |
Uploads the applet into the content module.
This method requires seven 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/TKMediaAgentsheetsEditor.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. The fifth and sixth parameters are the number of rows and number of columns in an applet. All of these parameters are usually handled by the TKMediaAgentSheetsEditor class after the user uploads the AgentSheets-generated index.html. The last parameter is the name of the default worksheet.
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.
$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 width of the applet, in pixels | |
$height | [integer]: the height of the applet, in pixels | |
$wsCols | [integer]: the number of columns in a worksheet | |
$wsRows | [integer]: the number of rows in a worksheet | |
$worksheet | [string]: this string is the name of the default worksheet. | |
$addlWorksheets | [array]: additional worksheets to be included in model (beyond the default worksheet) |