ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilContentPagePageCommandForwarder Class Reference

Class ilContentPagePageCommandForwarder. More...

+ Inheritance diagram for ilContentPagePageCommandForwarder:
+ Collaboration diagram for ilContentPagePageCommandForwarder:

Public Member Functions

 __construct (\Psr\Http\Message\ServerRequestInterface $request, \ilCtrl $ctrl, \ilTabsGUI $tabs, \ilLanguage $lng, \ilObjContentPage $parentObject)
 ilContentPagePageCommandForwarder constructor. More...
 
 setPresentationMode (string $presentationMode)
 
 forward (string $ctrlLink='')
 

Data Fields

const PRESENTATION_MODE_EDITING = 'PRESENTATION_MODE_EDITING'
 presentation mode for authoring More...
 
const PRESENTATION_MODE_PRESENTATION = 'PRESENTATION_MODE_PRESENTATION'
 presentation mode for requesting More...
 
const PRESENTATION_MODE_EMBEDDED_PRESENTATION = 'PRESENTATION_MODE_EMBEDDED_PRESENTATION'
 presentation mode for embedded presentation, e.g. More...
 
- Data Fields inherited from ilContentPageObjectConstants
const OBJ_TYPE = 'copa'
 
const UI_CMD_VIEW = 'view'
 
const UI_CMD_EDIT = 'edit'
 
const UI_CMD_UPDATE = 'update'
 
const UI_CMD_COPAGE_DOWNLOAD_FILE = 'downloadFile'
 
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN = 'displayMediaFullscreen'
 
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH = 'download_paragraph'
 
const UI_TAB_ID_CONTENT = 'content'
 
const UI_TAB_ID_INFO = 'info_short'
 
const UI_TAB_ID_SETTINGS = 'settings'
 
const UI_TAB_ID_ICON = 'icon'
 
const UI_TAB_ID_STYLE = 'style'
 
const UI_TAB_ID_LP = 'learning_progress'
 
const UI_TAB_ID_EXPORT = 'export'
 
const UI_TAB_ID_PERMISSIONS = 'perm_settings'
 

Protected Member Functions

 getPageObjectGUI ($isEmbedded=false)
 
 ensurePageObjectExists ()
 
 setBackLinkTab ()
 
 buildEditingPageObjectGUI ()
 
 buildPresentationPageObjectGUI ()
 
 buildEmbeddedPresentationPageObjectGUI ()
 

Protected Attributes

 $presentationMode = self::PRESENTATION_MODE_EDITING
 
 $ctrl
 
 $lng
 
 $tabs
 
 $parentObject
 
 $backUrl = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilContentPagePageCommandForwarder::__construct ( \Psr\Http\Message\ServerRequestInterface  $request,
\ilCtrl  $ctrl,
\ilTabsGUI  $tabs,
\ilLanguage  $lng,
\ilObjContentPage  $parentObject 
)

ilContentPagePageCommandForwarder constructor.

Parameters
\Psr\Http\Message\ServerRequestInterface$request
\ilCtrl$ctrl
\ilTabsGUI$tabs
\ilLanguage$lng
\ilObjContentPage$parentObject

Definition at line 62 of file class.ilContentPagePageCommandForwarder.php.

References $ctrl, $lng, $parentObject, and $tabs.

68  {
69  $this->ctrl = $ctrl;
70  $this->tabs = $tabs;
71  $this->lng = $lng;
72  $this->parentObject = $parentObject;
73 
74  $this->lng->loadLanguageModule('content');
75 
76  $this->backUrl = $request->getQueryParams()['backurl'] ?? '';
77 
78  if (strlen($this->backUrl) > 0) {
79  $this->ctrl->setParameterByClass('ilcontentpagepagegui', 'backurl', rawurlencode($this->backUrl));
80  }
81  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

Member Function Documentation

◆ buildEditingPageObjectGUI()

ilContentPagePageCommandForwarder::buildEditingPageObjectGUI ( )
protected
Returns

Definition at line 137 of file class.ilContentPagePageCommandForwarder.php.

References ensurePageObjectExists(), getPageObjectGUI(), and setBackLinkTab().

Referenced by forward().

138  {
139  $this->tabs->clearTargets();
140 
141  $this->setBackLinkTab();
142 
143  $this->ensurePageObjectExists();
144 
145  $pageObjectGUI = $this->getPageObjectGUI();
146  $pageObjectGUI->setEnabledTabs(true);
147 
148  return $pageObjectGUI;
149  }
Class ilContentPagePageGUI ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilContentPagePageGUI: ilPublicUserProfileGUI, ilNoteGUI ilContentPagePageGUI: ilPropertyFormGUI, ilInternalLinkGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEmbeddedPresentationPageObjectGUI()

ilContentPagePageCommandForwarder::buildEmbeddedPresentationPageObjectGUI ( )
protected
Returns

Definition at line 174 of file class.ilContentPagePageCommandForwarder.php.

References ensurePageObjectExists(), ilObjStyleSheet\getEffectiveContentStyleId(), and getPageObjectGUI().

Referenced by forward().

175  {
176  $this->ensurePageObjectExists();
177 
178  $pageObjectGUI = $this->getPageObjectGUI(true);
179  $pageObjectGUI->setEnabledTabs(false);
180 
181  $pageObjectGUI->setStyleId(
183  $this->parentObject->getStyleSheetId(),
184  $this->parentObject->getType()
185  )
186  );
187 
188  return $pageObjectGUI;
189  }
Class ilContentPagePageGUI ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilContentPagePageGUI: ilPublicUserProfileGUI, ilNoteGUI ilContentPagePageGUI: ilPropertyFormGUI, ilInternalLinkGUI.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPresentationPageObjectGUI()

ilContentPagePageCommandForwarder::buildPresentationPageObjectGUI ( )
protected
Returns

Definition at line 154 of file class.ilContentPagePageCommandForwarder.php.

References ensurePageObjectExists(), ilObjStyleSheet\getEffectiveContentStyleId(), and getPageObjectGUI().

Referenced by forward().

155  {
156  $this->ensurePageObjectExists();
157 
158  $pageObjectGUI = $this->getPageObjectGUI();
159  $pageObjectGUI->setEnabledTabs(false);
160 
161  $pageObjectGUI->setStyleId(
163  $this->parentObject->getStyleSheetId(),
164  $this->parentObject->getType()
165  )
166  );
167 
168  return $pageObjectGUI;
169  }
Class ilContentPagePageGUI ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilContentPagePageGUI: ilPublicUserProfileGUI, ilNoteGUI ilContentPagePageGUI: ilPropertyFormGUI, ilInternalLinkGUI.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensurePageObjectExists()

ilContentPagePageCommandForwarder::ensurePageObjectExists ( )
protected

Definition at line 105 of file class.ilContentPagePageCommandForwarder.php.

References ilPageObject\_exists().

Referenced by buildEditingPageObjectGUI(), buildEmbeddedPresentationPageObjectGUI(), and buildPresentationPageObjectGUI().

106  {
107  if (!\ilContentPagePage::_exists($this->parentObject->getType(), $this->parentObject->getId())) {
108  $pageObject = new \ilContentPagePage();
109  $pageObject->setParentId($this->parentObject->getId());
110  $pageObject->setId($this->parentObject->getId());
111  $pageObject->createFromXML();
112  }
113  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forward()

ilContentPagePageCommandForwarder::forward ( string  $ctrlLink = '')
Parameters
string$ctrlLink
Returns
string
Exceptions
ilCtrlException
ilException

Definition at line 205 of file class.ilContentPagePageCommandForwarder.php.

References buildEditingPageObjectGUI(), buildEmbeddedPresentationPageObjectGUI(), and buildPresentationPageObjectGUI().

205  : string
206  {
207  switch ($this->presentationMode) {
208  case self::PRESENTATION_MODE_EDITING:
209 
210  $pageObjectGui = $this->buildEditingPageObjectGUI();
211  return (string) $this->ctrl->forwardCommand($pageObjectGui);
212 
213  case self::PRESENTATION_MODE_PRESENTATION:
214  $pageObjectGUI = $this->buildPresentationPageObjectGUI();
215 
216  if (is_string($ctrlLink) && strlen($ctrlLink) > 0) {
217  $pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);
218  $pageObjectGUI->setFullscreenLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN);
219  $pageObjectGUI->setSourcecodeDownloadScript($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH);
220  }
221 
222  return $this->ctrl->getHTML($pageObjectGUI);
223 
224  case self::PRESENTATION_MODE_EMBEDDED_PRESENTATION:
225  $pageObjectGUI = $this->buildEmbeddedPresentationPageObjectGUI();
226 
227  if (is_string($ctrlLink) && strlen($ctrlLink) > 0) {
228  $pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);
229  $pageObjectGUI->setFullscreenLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN);
230  $pageObjectGUI->setSourcecodeDownloadScript($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH);
231  }
232 
233  return $pageObjectGUI->getHTML();
234 
235  default:
236  throw new \ilException('Unknown presentation mode given');
237  break;
238  }
239  }
+ Here is the call graph for this function:

◆ getPageObjectGUI()

ilContentPagePageCommandForwarder::getPageObjectGUI (   $isEmbedded = false)
protected
Parameters
bool$isEmbedded
Returns

Definition at line 87 of file class.ilContentPagePageCommandForwarder.php.

References ilObjStyleSheet\getEffectiveContentStyleId(), and ilPageObjectGUI\setStyleId().

Referenced by buildEditingPageObjectGUI(), buildEmbeddedPresentationPageObjectGUI(), and buildPresentationPageObjectGUI().

88  {
89  $pageObjectGUI = new \ilContentPagePageGUI($this->parentObject->getId(), 0, $isEmbedded);
90  $pageObjectGUI->setStyleId(
92  $this->parentObject->getStyleSheetId(),
93  $this->parentObject->getType()
94  )
95  );
96 
97  $pageObjectGUI->obj->addUpdateListener($this->parentObject, 'update');
98 
99  return $pageObjectGUI;
100  }
Class ilContentPagePageGUI ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilContentPagePageGUI: ilPublicUserProfileGUI, ilNoteGUI ilContentPagePageGUI: ilPropertyFormGUI, ilInternalLinkGUI.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
setStyleId($a_styleid)
Set Style Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBackLinkTab()

ilContentPagePageCommandForwarder::setBackLinkTab ( )
protected

Definition at line 118 of file class.ilContentPagePageCommandForwarder.php.

References $backUrl, and ilUtil\stripSlashes().

Referenced by buildEditingPageObjectGUI().

119  {
120  $backUrl = $this->ctrl->getLinkTargetByClass('ilObjContentPageGUI', self::UI_CMD_VIEW);
121  if (strlen($this->backUrl) > 0) {
122  $backUrlParts = parse_url(\ilUtil::stripSlashes($this->backUrl));
123 
124  $script = basename($backUrlParts['path']);
125 
126  $backUrl = './' . implode('?', [
127  $script, $backUrlParts['query']
128  ]);
129  }
130 
131  $this->tabs->setBackTarget($this->lng->txt('back'), $backUrl);
132  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilContentPagePageCommandForwarder::setPresentationMode ( string  $presentationMode)
Parameters
string$presentationMode

Definition at line 194 of file class.ilContentPagePageCommandForwarder.php.

References $presentationMode.

195  {
196  $this->presentationMode = $presentationMode;
197  }

Field Documentation

◆ $backUrl

ilContentPagePageCommandForwarder::$backUrl = ''
protected

Definition at line 52 of file class.ilContentPagePageCommandForwarder.php.

Referenced by setBackLinkTab().

◆ $ctrl

ilContentPagePageCommandForwarder::$ctrl
protected

Definition at line 32 of file class.ilContentPagePageCommandForwarder.php.

Referenced by __construct().

◆ $lng

ilContentPagePageCommandForwarder::$lng
protected

Definition at line 37 of file class.ilContentPagePageCommandForwarder.php.

Referenced by __construct().

◆ $parentObject

ilContentPagePageCommandForwarder::$parentObject
protected

Definition at line 47 of file class.ilContentPagePageCommandForwarder.php.

Referenced by __construct().

◆ $presentationMode

ilContentPagePageCommandForwarder::$presentationMode = self::PRESENTATION_MODE_EDITING
protected

Definition at line 27 of file class.ilContentPagePageCommandForwarder.php.

Referenced by setPresentationMode().

◆ $tabs

ilContentPagePageCommandForwarder::$tabs
protected

Definition at line 42 of file class.ilContentPagePageCommandForwarder.php.

Referenced by __construct().

◆ PRESENTATION_MODE_EDITING

const ilContentPagePageCommandForwarder::PRESENTATION_MODE_EDITING = 'PRESENTATION_MODE_EDITING'

presentation mode for authoring

Definition at line 12 of file class.ilContentPagePageCommandForwarder.php.

◆ PRESENTATION_MODE_EMBEDDED_PRESENTATION

const ilContentPagePageCommandForwarder::PRESENTATION_MODE_EMBEDDED_PRESENTATION = 'PRESENTATION_MODE_EMBEDDED_PRESENTATION'

presentation mode for embedded presentation, e.g.

in a kiosk mode

Definition at line 22 of file class.ilContentPagePageCommandForwarder.php.

Referenced by ilContentPageKioskModeView\render().

◆ PRESENTATION_MODE_PRESENTATION

const ilContentPagePageCommandForwarder::PRESENTATION_MODE_PRESENTATION = 'PRESENTATION_MODE_PRESENTATION'

presentation mode for requesting

Definition at line 17 of file class.ilContentPagePageCommandForwarder.php.

Referenced by ilObjContentPageGUI\getContent().


The documentation for this class was generated from the following file: