2011-07-21 20:14:33 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Interface to provide enough information about a record to make it previewable
|
2013-10-15 00:26:23 +02:00
|
|
|
* through the CMS. It uses the record database ID, its "frontend" and "backend"
|
|
|
|
* links to link up the edit form with its preview.
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2013-10-15 00:26:23 +02:00
|
|
|
* Also used by {@link SilverStripeNavigator} to generate links - both within
|
|
|
|
* the CMS preview, and as a frontend utility for logged-in CMS authors in
|
|
|
|
* custom themes (with the $SilverStripeNavigator template marker).
|
|
|
|
*
|
|
|
|
* @package framework
|
|
|
|
* @subpackage admin
|
2011-07-21 20:14:33 +02:00
|
|
|
*/
|
|
|
|
interface CMSPreviewable {
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2011-07-21 20:14:33 +02:00
|
|
|
/**
|
2016-04-28 01:41:40 +02:00
|
|
|
* Determine the preview link, if available, for this object.
|
|
|
|
* If no preview is available for this record, it may return null.
|
|
|
|
*
|
2016-04-27 04:26:39 +02:00
|
|
|
* @param string $action
|
2016-04-28 01:41:40 +02:00
|
|
|
* @return string Link to the end-user view for this record.
|
2011-07-21 20:14:33 +02:00
|
|
|
* Example: http://mysite.com/my-record
|
|
|
|
*/
|
2016-04-27 04:26:39 +02:00
|
|
|
public function PreviewLink($action = null);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2011-07-21 20:14:33 +02:00
|
|
|
/**
|
2016-04-28 01:41:40 +02:00
|
|
|
* To determine preview mechanism (e.g. embedded / iframe)
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getMimeType();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string Link to the CMS-author view. Should point to a
|
2013-10-15 00:26:23 +02:00
|
|
|
* controller subclassing {@link LeftAndMain}. Example:
|
|
|
|
* http://mysite.com/admin/edit/6
|
2011-07-21 20:14:33 +02:00
|
|
|
*/
|
2012-09-19 12:07:39 +02:00
|
|
|
public function CMSEditLink();
|
2011-07-21 20:14:33 +02:00
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|