ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssOrderingElement Class Reference
+ Collaboration diagram for ilAssOrderingElement:

Public Member Functions

 __construct ()
 ilAssOrderingElement constructor. More...
 
 __clone ()
 Cloning. More...
 
 getClone ()
 
 getId ()
 
 setId ($id)
 
 getRandomIdentifier ()
 
 setRandomIdentifier ($randomIdentifier)
 
 getSolutionIdentifier ()
 
 setSolutionIdentifier ($solutionIdentifier)
 
 setIndentation ($indentation)
 
 getIndentation ()
 
 getPosition ()
 
 setPosition ($position)
 
 getContent ()
 
 setContent ($content)
 
 getUploadImageFile ()
 
 setUploadImageFile ($uploadImageFile)
 
 getUploadImageName ()
 
 setUploadImageName ($uploadImageName)
 
 isImageUploadAvailable ()
 
 isImageRemovalRequest ()
 
 setImageRemovalRequest ($imageRemovalRequest)
 
 getImagePathWeb ()
 
 setImagePathWeb ($imagePathWeb)
 
 getImagePathFs ()
 
 setImagePathFs ($imagePathFs)
 
 getImageThumbnailPrefix ()
 
 setImageThumbnailPrefix ($imageThumbnailPrefix)
 
 isSameElement (ilAssOrderingElement $element)
 
 getStorageValue1 ($orderingType)
 
 getStorageValue2 ($orderingType)
 
 __toString ()
 
 getPresentationImageUrl ()
 
 getExportIdent ()
 
 isExportIdent ($ident)
 
 setExportIdent ($ident)
 

Data Fields

const EXPORT_IDENT_PROPERTY_SEPARATOR = '_'
 
 $objectInstanceId
 
 $id = -1
 

Static Public Attributes

static $objectInstanceCounter = 0
 

Protected Member Functions

 thumbnailFileExists ()
 
 getThumbnailFilePath ()
 
 getThumbnailFileUrl ()
 
 imageFileExists ()
 
 getImageFilePath ()
 
 getImageFileUrl ()
 

Protected Attributes

 $randomIdentifier = null
 
 $solutionIdentifier = null
 
 $indentation = 0
 
 $position = null
 
 $content = null
 
 $uploadImageName = null
 
 $uploadImageFile = null
 
 $imageRemovalRequest = null
 
 $imagePathWeb = null
 
 $imagePathFs = null
 
 $imageThumbnailPrefix = null
 

Detailed Description

Definition at line 11 of file class.ilAssOrderingElement.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssOrderingElement::__construct ( )

ilAssOrderingElement constructor.

Definition at line 106 of file class.ilAssOrderingElement.php.

107  {
108  $this->objectInstanceId = ++self::$objectInstanceCounter;
109  }

Member Function Documentation

◆ __clone()

ilAssOrderingElement::__clone ( )

Cloning.

Definition at line 114 of file class.ilAssOrderingElement.php.

115  {
116  $this->objectInstanceId = ++self::$objectInstanceCounter;
117  }

◆ __toString()

ilAssOrderingElement::__toString ( )

Definition at line 382 of file class.ilAssOrderingElement.php.

References getContent().

383  {
384  return $this->getContent();
385  }
+ Here is the call graph for this function:

◆ getClone()

ilAssOrderingElement::getClone ( )
Returns
ilAssOrderingElement

Definition at line 122 of file class.ilAssOrderingElement.php.

123  {
124  return clone $this;
125  }

◆ getContent()

◆ getExportIdent()

ilAssOrderingElement::getExportIdent ( )

Definition at line 438 of file class.ilAssOrderingElement.php.

References array, getIndentation(), getPosition(), getRandomIdentifier(), and getSolutionIdentifier().

439  {
440  $ident = array(
441  $this->getRandomIdentifier(),
442  $this->getSolutionIdentifier(),
443  $this->getPosition(),
444  $this->getIndentation()
445  );
446 
447  return implode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
448  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getId()

ilAssOrderingElement::getId ( )
Returns
int

Definition at line 130 of file class.ilAssOrderingElement.php.

References $id.

Referenced by ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject().

131  {
132  return $this->id;
133  }
+ Here is the caller graph for this function:

◆ getImageFilePath()

ilAssOrderingElement::getImageFilePath ( )
protected

Definition at line 415 of file class.ilAssOrderingElement.php.

References getContent(), and getImagePathFs().

Referenced by imageFileExists().

416  {
417  return $this->getImagePathFs() . $this->getContent();
418  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageFileUrl()

ilAssOrderingElement::getImageFileUrl ( )
protected

Definition at line 420 of file class.ilAssOrderingElement.php.

References getContent(), and getImagePathWeb().

Referenced by getPresentationImageUrl().

421  {
422  return $this->getImagePathWeb() . $this->getContent();
423  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImagePathFs()

ilAssOrderingElement::getImagePathFs ( )
Returns
string

Definition at line 298 of file class.ilAssOrderingElement.php.

References $imagePathFs.

Referenced by getImageFilePath(), and getThumbnailFilePath().

299  {
300  return $this->imagePathFs;
301  }
+ Here is the caller graph for this function:

◆ getImagePathWeb()

ilAssOrderingElement::getImagePathWeb ( )
Returns
string

Definition at line 282 of file class.ilAssOrderingElement.php.

References $imagePathWeb.

Referenced by getImageFileUrl(), and getThumbnailFileUrl().

+ Here is the caller graph for this function:

◆ getImageThumbnailPrefix()

ilAssOrderingElement::getImageThumbnailPrefix ( )
Returns
null

Definition at line 314 of file class.ilAssOrderingElement.php.

References $imageThumbnailPrefix.

Referenced by getThumbnailFilePath(), and getThumbnailFileUrl().

+ Here is the caller graph for this function:

◆ getIndentation()

ilAssOrderingElement::getIndentation ( )
Returns
int

Definition at line 186 of file class.ilAssOrderingElement.php.

References $indentation.

Referenced by getExportIdent(), getStorageValue2(), ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject(), and isSameElement().

187  {
188  return $this->indentation;
189  }
+ Here is the caller graph for this function:

◆ getPosition()

ilAssOrderingElement::getPosition ( )
Returns
int

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

References $position.

Referenced by getExportIdent(), getStorageValue1(), getStorageValue2(), ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject(), and isSameElement().

195  {
196  return $this->position;
197  }
+ Here is the caller graph for this function:

◆ getPresentationImageUrl()

ilAssOrderingElement::getPresentationImageUrl ( )

Definition at line 425 of file class.ilAssOrderingElement.php.

References getImageFileUrl(), getThumbnailFileUrl(), imageFileExists(), and thumbnailFileExists().

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

426  {
427  if ($this->thumbnailFileExists()) {
428  return $this->getThumbnailFileUrl();
429  }
430 
431  if ($this->imageFileExists()) {
432  return $this->getImageFileUrl();
433  }
434 
435  return '';
436  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRandomIdentifier()

ilAssOrderingElement::getRandomIdentifier ( )
Returns
integer $randomIdentifier

Definition at line 146 of file class.ilAssOrderingElement.php.

References $randomIdentifier.

Referenced by ilAssOrderingElementList\fetchIdentifier(), getExportIdent(), getStorageValue2(), ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject(), and isSameElement().

+ Here is the caller graph for this function:

◆ getSolutionIdentifier()

ilAssOrderingElement::getSolutionIdentifier ( )
Returns
int

Definition at line 162 of file class.ilAssOrderingElement.php.

References $solutionIdentifier.

Referenced by ilAssOrderingElementList\fetchIdentifier(), getExportIdent(), getStorageValue1(), and isSameElement().

+ Here is the caller graph for this function:

◆ getStorageValue1()

ilAssOrderingElement::getStorageValue1 (   $orderingType)

Definition at line 352 of file class.ilAssOrderingElement.php.

References getPosition(), getSolutionIdentifier(), OQ_NESTED_PICTURES, OQ_NESTED_TERMS, OQ_PICTURES, and OQ_TERMS.

353  {
354  switch ($orderingType) {
355  case OQ_NESTED_TERMS:
356  case OQ_NESTED_PICTURES:
357 
358  return $this->getPosition();
359 
360  case OQ_TERMS:
361  case OQ_PICTURES:
362 
363  return $this->getSolutionIdentifier();
364  }
365  }
const OQ_NESTED_TERMS
const OQ_PICTURES
Ordering question constants.
const OQ_TERMS
const OQ_NESTED_PICTURES
+ Here is the call graph for this function:

◆ getStorageValue2()

ilAssOrderingElement::getStorageValue2 (   $orderingType)

Definition at line 367 of file class.ilAssOrderingElement.php.

References getIndentation(), getPosition(), getRandomIdentifier(), OQ_NESTED_PICTURES, OQ_NESTED_TERMS, OQ_PICTURES, and OQ_TERMS.

368  {
369  switch ($orderingType) {
370  case OQ_NESTED_TERMS:
371  case OQ_NESTED_PICTURES:
372 
373  return $this->getRandomIdentifier() . ':' . $this->getIndentation();
374 
375  case OQ_TERMS:
376  case OQ_PICTURES:
377 
378  return $this->getPosition() + 1;
379  }
380  }
const OQ_NESTED_TERMS
const OQ_PICTURES
Ordering question constants.
const OQ_TERMS
const OQ_NESTED_PICTURES
+ Here is the call graph for this function:

◆ getThumbnailFilePath()

ilAssOrderingElement::getThumbnailFilePath ( )
protected

Definition at line 396 of file class.ilAssOrderingElement.php.

References getContent(), getImagePathFs(), and getImageThumbnailPrefix().

Referenced by thumbnailFileExists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbnailFileUrl()

ilAssOrderingElement::getThumbnailFileUrl ( )
protected

Definition at line 401 of file class.ilAssOrderingElement.php.

References getContent(), getImagePathWeb(), and getImageThumbnailPrefix().

Referenced by getPresentationImageUrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUploadImageFile()

ilAssOrderingElement::getUploadImageFile ( )
Returns
string

Definition at line 226 of file class.ilAssOrderingElement.php.

References $uploadImageFile.

Referenced by isImageUploadAvailable().

+ Here is the caller graph for this function:

◆ getUploadImageName()

ilAssOrderingElement::getUploadImageName ( )
Returns
string

Definition at line 242 of file class.ilAssOrderingElement.php.

References $uploadImageName.

◆ imageFileExists()

ilAssOrderingElement::imageFileExists ( )
protected

Definition at line 406 of file class.ilAssOrderingElement.php.

References getContent(), and getImageFilePath().

Referenced by getPresentationImageUrl().

407  {
408  if (!strlen($this->getContent())) {
409  return false;
410  }
411 
412  return file_exists($this->getImageFilePath());
413  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isExportIdent()

ilAssOrderingElement::isExportIdent (   $ident)

Definition at line 450 of file class.ilAssOrderingElement.php.

References ilAssOrderingElementList\isValidIndentation(), ilAssOrderingElementList\isValidPosition(), ilAssOrderingElementList\isValidRandomIdentifier(), and ilAssOrderingElementList\isValidSolutionIdentifier().

Referenced by setExportIdent().

451  {
452  if (!strlen($ident)) {
453  return false;
454  }
455 
456  $parts = explode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
457 
458  if (count($parts) != 4) {
459  return false;
460  }
461 
463  return false;
464  }
465 
467  return false;
468  }
469 
471  return false;
472  }
473 
475  return false;
476  }
477 
478  return true;
479  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImageRemovalRequest()

ilAssOrderingElement::isImageRemovalRequest ( )
Returns
bool

Definition at line 266 of file class.ilAssOrderingElement.php.

References $imageRemovalRequest.

◆ isImageUploadAvailable()

ilAssOrderingElement::isImageUploadAvailable ( )
Returns
bool

Definition at line 258 of file class.ilAssOrderingElement.php.

References getUploadImageFile().

259  {
260  return (bool) strlen($this->getUploadImageFile());
261  }
+ Here is the call graph for this function:

◆ isSameElement()

ilAssOrderingElement::isSameElement ( ilAssOrderingElement  $element)
Parameters
ilAssOrderingElement$element
Returns
bool

Definition at line 331 of file class.ilAssOrderingElement.php.

References getIndentation(), getPosition(), getRandomIdentifier(), and getSolutionIdentifier().

332  {
333  if ($element->getRandomIdentifier() != $this->getRandomIdentifier()) {
334  return false;
335  }
336 
337  if ($element->getSolutionIdentifier() != $this->getSolutionIdentifier()) {
338  return false;
339  }
340 
341  if ($element->getPosition() != $this->getPosition()) {
342  return false;
343  }
344 
345  if ($element->getIndentation() != $this->getIndentation()) {
346  return false;
347  }
348 
349  return true;
350  }
+ Here is the call graph for this function:

◆ setContent()

ilAssOrderingElement::setContent (   $content)
Parameters
string$content

Definition at line 218 of file class.ilAssOrderingElement.php.

References $content.

219  {
220  $this->content = $content;
221  }

◆ setExportIdent()

ilAssOrderingElement::setExportIdent (   $ident)

Definition at line 481 of file class.ilAssOrderingElement.php.

References isExportIdent(), setIndentation(), setPosition(), setRandomIdentifier(), and setSolutionIdentifier().

482  {
483  if ($this->isExportIdent($ident)) {
484  list($randomId, $solutionId, $pos, $indent) = explode(
485  self::EXPORT_IDENT_PROPERTY_SEPARATOR,
486  $ident
487  );
488 
489  $this->setRandomIdentifier($randomId);
490  $this->setSolutionIdentifier($solutionId);
491  $this->setPosition($pos);
492  $this->setIndentation($indent);
493  }
494  }
setSolutionIdentifier($solutionIdentifier)
setRandomIdentifier($randomIdentifier)
+ Here is the call graph for this function:

◆ setId()

ilAssOrderingElement::setId (   $id)
Parameters
int$id

Definition at line 138 of file class.ilAssOrderingElement.php.

References $id.

139  {
140  $this->id = $id;
141  }

◆ setImagePathFs()

ilAssOrderingElement::setImagePathFs (   $imagePathFs)
Parameters
string$imagePathFs

Definition at line 306 of file class.ilAssOrderingElement.php.

References $imagePathFs.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

307  {
308  $this->imagePathFs = $imagePathFs;
309  }
+ Here is the caller graph for this function:

◆ setImagePathWeb()

ilAssOrderingElement::setImagePathWeb (   $imagePathWeb)
Parameters
string$imagePathWeb

Definition at line 290 of file class.ilAssOrderingElement.php.

References $imagePathWeb.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

291  {
292  $this->imagePathWeb = $imagePathWeb;
293  }
+ Here is the caller graph for this function:

◆ setImageRemovalRequest()

ilAssOrderingElement::setImageRemovalRequest (   $imageRemovalRequest)
Parameters
bool$imageRemovalRequest

Definition at line 274 of file class.ilAssOrderingElement.php.

References $imageRemovalRequest.

275  {
276  $this->imageRemovalRequest = $imageRemovalRequest;
277  }

◆ setImageThumbnailPrefix()

ilAssOrderingElement::setImageThumbnailPrefix (   $imageThumbnailPrefix)
Parameters
null$imageThumbnailPrefix

Definition at line 322 of file class.ilAssOrderingElement.php.

References $imageThumbnailPrefix.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

323  {
324  $this->imageThumbnailPrefix = $imageThumbnailPrefix;
325  }
+ Here is the caller graph for this function:

◆ setIndentation()

ilAssOrderingElement::setIndentation (   $indentation)
Parameters
int$indentation

Definition at line 178 of file class.ilAssOrderingElement.php.

References $indentation.

Referenced by setExportIdent().

179  {
180  $this->indentation = $indentation;
181  }
+ Here is the caller graph for this function:

◆ setPosition()

ilAssOrderingElement::setPosition (   $position)
Parameters
int$position

Definition at line 202 of file class.ilAssOrderingElement.php.

References $position.

Referenced by setExportIdent().

203  {
204  $this->position = $position;
205  }
+ Here is the caller graph for this function:

◆ setRandomIdentifier()

ilAssOrderingElement::setRandomIdentifier (   $randomIdentifier)
Parameters
$randomIdentifier

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

References $randomIdentifier.

Referenced by ilAssOrderingElementList\populateIdentifier(), and setExportIdent().

155  {
156  $this->randomIdentifier = $randomIdentifier;
157  }
+ Here is the caller graph for this function:

◆ setSolutionIdentifier()

ilAssOrderingElement::setSolutionIdentifier (   $solutionIdentifier)
Parameters
int$solutionIdentifier

Definition at line 170 of file class.ilAssOrderingElement.php.

References $solutionIdentifier.

Referenced by ilAssOrderingElementList\populateIdentifier(), and setExportIdent().

171  {
172  $this->solutionIdentifier = $solutionIdentifier;
173  }
+ Here is the caller graph for this function:

◆ setUploadImageFile()

ilAssOrderingElement::setUploadImageFile (   $uploadImageFile)
Parameters
string$uploadImageFile

Definition at line 234 of file class.ilAssOrderingElement.php.

References $uploadImageFile.

235  {
236  $this->uploadImageFile = $uploadImageFile;
237  }

◆ setUploadImageName()

ilAssOrderingElement::setUploadImageName (   $uploadImageName)
Parameters
string$uploadImageName

Definition at line 250 of file class.ilAssOrderingElement.php.

References $uploadImageName.

251  {
252  $this->uploadImageName = $uploadImageName;
253  }

◆ thumbnailFileExists()

ilAssOrderingElement::thumbnailFileExists ( )
protected

Definition at line 387 of file class.ilAssOrderingElement.php.

References getContent(), and getThumbnailFilePath().

Referenced by getPresentationImageUrl().

388  {
389  if (!strlen($this->getContent())) {
390  return false;
391  }
392 
393  return file_exists($this->getThumbnailFilePath());
394  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $content

ilAssOrderingElement::$content = null
protected

Definition at line 71 of file class.ilAssOrderingElement.php.

Referenced by getContent(), and setContent().

◆ $id

ilAssOrderingElement::$id = -1

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

Referenced by getId(), and setId().

◆ $imagePathFs

ilAssOrderingElement::$imagePathFs = null
protected

Definition at line 96 of file class.ilAssOrderingElement.php.

Referenced by getImagePathFs(), and setImagePathFs().

◆ $imagePathWeb

ilAssOrderingElement::$imagePathWeb = null
protected

Definition at line 91 of file class.ilAssOrderingElement.php.

Referenced by getImagePathWeb(), and setImagePathWeb().

◆ $imageRemovalRequest

ilAssOrderingElement::$imageRemovalRequest = null
protected

Definition at line 86 of file class.ilAssOrderingElement.php.

Referenced by isImageRemovalRequest(), and setImageRemovalRequest().

◆ $imageThumbnailPrefix

ilAssOrderingElement::$imageThumbnailPrefix = null
protected

◆ $indentation

ilAssOrderingElement::$indentation = 0
protected

Definition at line 59 of file class.ilAssOrderingElement.php.

Referenced by getIndentation(), and setIndentation().

◆ $objectInstanceCounter

ilAssOrderingElement::$objectInstanceCounter = 0
static

Definition at line 15 of file class.ilAssOrderingElement.php.

◆ $objectInstanceId

ilAssOrderingElement::$objectInstanceId

Definition at line 16 of file class.ilAssOrderingElement.php.

◆ $position

ilAssOrderingElement::$position = null
protected

Definition at line 66 of file class.ilAssOrderingElement.php.

Referenced by getPosition(), and setPosition().

◆ $randomIdentifier

ilAssOrderingElement::$randomIdentifier = null
protected

Definition at line 38 of file class.ilAssOrderingElement.php.

Referenced by getRandomIdentifier(), and setRandomIdentifier().

◆ $solutionIdentifier

ilAssOrderingElement::$solutionIdentifier = null
protected

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

Referenced by getSolutionIdentifier(), and setSolutionIdentifier().

◆ $uploadImageFile

ilAssOrderingElement::$uploadImageFile = null
protected

Definition at line 81 of file class.ilAssOrderingElement.php.

Referenced by getUploadImageFile(), and setUploadImageFile().

◆ $uploadImageName

ilAssOrderingElement::$uploadImageName = null
protected

Definition at line 76 of file class.ilAssOrderingElement.php.

Referenced by getUploadImageName(), and setUploadImageName().

◆ EXPORT_IDENT_PROPERTY_SEPARATOR

const ilAssOrderingElement::EXPORT_IDENT_PROPERTY_SEPARATOR = '_'

Definition at line 13 of file class.ilAssOrderingElement.php.


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