
Public Member Functions | |
| __construct ($version, $mode=self::MODE_DEFAULT) | |
| Base constructor for previews. | |
Protected Member Functions | |
| getFormattedSource () | |
| Generates an HTML display of the content in some usable format. | |
| getParameters ($name) | |
| Retrieves parameter arrays for translators. | |
| getTranslators () | |
| Returns array of translator pretty and ugly names. | |
| showAdditionalInfo () | |
| Displays additional information about the version. | |
Private Member Functions | |
| previewVersion () | |
| showInfoInt () | |
The preview frame shows the user what the content will look like through various translators, and also displays the source and other information about the content. This component can easily be dropped in to show content previews and is used by the Snap2 editors so that a preview of the latest revision of the content can be display.
Definition at line 11 of file TKSnapPreview.php5.
| TKSnapPreview::__construct | ( | $ | version, | |
| $ | mode = self::MODE_DEFAULT | |||
| ) |
Base constructor for previews.
You should not override this constructor in derived classes
| $version | [SnapVersion]: version whose content is being previewed | |
| $mode | [int]: preview mode: can be either TKSnapPreview::MODE_DEFAULT or TKSnapPreview::MODE_BASIC |
Definition at line 25 of file TKSnapPreview.php5.
References previewVersion(), and showInfoInt().
| TKSnapPreview::getFormattedSource | ( | ) | [abstract, protected] |
Generates an HTML display of the content in some usable format.
The preview frame in the Snap2 admin tool has a Formatted Source tab which shows the source (non-translated) in some way that is visually appealing. For XML/HTML content, the source should probably remain intact, albeit with syntax highlighting and the like. For other types of content, a more descriptive approach should be used, such as a table listing all of the attributes stored in the database.
Reimplemented in TKSnapCssPreview, TKSnapHtmlPreview, TKSnapInteractivateInstructorPreview, TKSnapInteractivateLessonPreview, TKSnapLessonPlanPreview, TKSnapMediaAgentsheetsPreview, TKSnapMediaDocumentPreview, TKSnapMediaFilePreview, TKSnapMediaImagePreview, TKSnapMediaInteractivatePreview, TKSnapMediaNetlogoPreview, and TKSnapXmlPreview.
Referenced by previewVersion().
| TKSnapPreview::getParameters | ( | $ | name | ) | [protected] |
Retrieves parameter arrays for translators.
A translator may need additional parameters. If so, then override this method and return an array of additional parameters to be passed to $prm->load(). The '$name' argument is the "pretty name" displayed in the drop down. If no extra parameters need to be passed, just return an empty array.
| $name | [string]: pretty name whose parameters need to be retrieved |
Reimplemented in TKSnapMediaImagePreview.
Definition at line 257 of file TKSnapPreview.php5.
Referenced by previewVersion().
| TKSnapPreview::getTranslators | ( | ) | [abstract, protected] |
Returns array of translator pretty and ugly names.
The array returned must be associative. The key for each element is the pretty name to be displayed in the translator drop down in the preview frame. The value is the name of the translator class (the 'ugly' name). You do not need to include entries for Formatted Source and Raw Source as these are generated automatically.
Reimplemented in TKSnapCssPreview, TKSnapHtmlPreview, TKSnapInteractivateInstructorPreview, TKSnapInteractivateLessonPreview, TKSnapLessonPlanPreview, TKSnapMediaAgentsheetsPreview, TKSnapMediaDocumentPreview, TKSnapMediaFilePreview, TKSnapMediaImagePreview, TKSnapMediaInteractivatePreview, TKSnapMediaNetlogoPreview, and TKSnapXmlPreview.
Referenced by previewVersion().
| TKSnapPreview::previewVersion | ( | ) | [private] |
For internal use only.
Definition at line 51 of file TKSnapPreview.php5.
References TKContainer::addText(), getFormattedSource(), TKComponent::getId(), SConfig::getOption(), getParameters(), getTranslators(), SConfig::setDefault(), SnapVersion::STATUS_DEFUNCT, SnapVersion::STATUS_DEV, SnapVersion::STATUS_LIVE, SnapVersion::STATUS_PENDING, SnapVersion::STATUS_PRIVATE, SnapResource::TYPE_HTML, SnapResource::TYPE_INTERACTIVATE_INSTRUCTOR, SnapResource::TYPE_INTERACTIVATE_LESSON, SnapResource::TYPE_LESSONPLAN, and SnapResource::TYPE_STDXML.
Referenced by __construct().
| TKSnapPreview::showAdditionalInfo | ( | ) | [protected] |
Displays additional information about the version.
The additional information may be a table of attributes, or media tags, etc. If you do not need to display any additional information, then do not override this function (the default implementation displays nothing). Return a toolkit component which will be added at the appropriate place in the page. Return null if nothing is to be displayed.
Reimplemented in TKSnapMediaAgentsheetsPreview, TKSnapMediaDocumentPreview, TKSnapMediaFilePreview, TKSnapMediaImagePreview, TKSnapMediaInteractivatePreview, and TKSnapMediaNetlogoPreview.
Definition at line 244 of file TKSnapPreview.php5.
Referenced by showInfoInt().
| TKSnapPreview::showInfoInt | ( | ) | [private] |
For internal use only.
Definition at line 36 of file TKSnapPreview.php5.
References TKContainer::addText(), and showAdditionalInfo().
Referenced by __construct().
1.5.6