ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 }

References $objectInstanceCounter.

Member Function Documentation

◆ __clone()

ilAssOrderingElement::__clone ( )

Cloning.

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

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

References $objectInstanceCounter.

◆ __toString()

ilAssOrderingElement::__toString ( )

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

389 {
390 return $this->getContent();
391 }

References getContent().

+ 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 448 of file class.ilAssOrderingElement.php.

449 {
450 $ident = array(
451 $this->getRandomIdentifier(),
452 $this->getSolutionIdentifier(),
453 $this->getPosition(),
454 $this->getIndentation()
455 );
456
457 return implode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
458 }

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

+ 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().

+ Here is the caller graph for this function:

◆ getImageFilePath()

ilAssOrderingElement::getImageFilePath ( )
protected

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

424 {
425 return $this->getImagePathFs() . $this->getContent();
426 }

References getContent(), and getImagePathFs().

Referenced by imageFileExists().

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

◆ getImageFileUrl()

ilAssOrderingElement::getImageFileUrl ( )
protected

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

429 {
430 return $this->getImagePathWeb() . $this->getContent();
431 }

References getContent(), and getImagePathWeb().

Referenced by getPresentationImageUrl().

+ 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().

+ 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().

+ 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().

+ Here is the caller graph for this function:

◆ getPresentationImageUrl()

ilAssOrderingElement::getPresentationImageUrl ( )

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

434 {
435 if( $this->thumbnailFileExists() )
436 {
437 return $this->getThumbnailFileUrl();
438 }
439
440 if( $this->imageFileExists() )
441 {
442 return $this->getImageFileUrl();
443 }
444
445 return '';
446 }

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

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

+ 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 356 of file class.ilAssOrderingElement.php.

357 {
358 switch( $orderingType )
359 {
360 case OQ_NESTED_TERMS:
362
363 return $this->getPosition();
364
365 case OQ_TERMS:
366 case OQ_PICTURES:
367
368 return $this->getSolutionIdentifier();
369 }
370 }
const OQ_NESTED_PICTURES
const OQ_TERMS
const OQ_NESTED_TERMS
const OQ_PICTURES
Ordering question constants.

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

+ Here is the call graph for this function:

◆ getStorageValue2()

ilAssOrderingElement::getStorageValue2 (   $orderingType)

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

373 {
374 switch( $orderingType )
375 {
376 case OQ_NESTED_TERMS:
378
379 return $this->getRandomIdentifier() . ':' . $this->getIndentation();
380
381 case OQ_TERMS:
382 case OQ_PICTURES:
383
384 return $this->getPosition() + 1;
385 }
386 }

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

+ Here is the call graph for this function:

◆ getThumbnailFilePath()

ilAssOrderingElement::getThumbnailFilePath ( )
protected

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

404 {
405 return $this->getImagePathFs() . $this->getImageThumbnailPrefix() . $this->getContent();
406 }

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 408 of file class.ilAssOrderingElement.php.

409 {
410 return $this->getImagePathWeb() . $this->getImageThumbnailPrefix() . $this->getContent();
411 }

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 413 of file class.ilAssOrderingElement.php.

414 {
415 if( !strlen($this->getContent()) )
416 {
417 return false;
418 }
419
420 return file_exists($this->getImageFilePath());
421 }

References getContent(), and getImageFilePath().

Referenced by getPresentationImageUrl().

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

◆ isExportIdent()

ilAssOrderingElement::isExportIdent (   $ident)

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

461 {
462 if( !strlen($ident) )
463 {
464 return false;
465 }
466
467 $parts = explode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
468
469 if( count($parts) != 4 )
470 {
471 return false;
472 }
473
475 {
476 return false;
477 }
478
480 {
481 return false;
482 }
483
485 {
486 return false;
487 }
488
490 {
491 return false;
492 }
493
494 return true;
495 }

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

Referenced by setExportIdent().

+ 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.

259 {
260 return (bool)strlen( $this->getUploadImageFile() );
261 }

References getUploadImageFile().

+ 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.

332 {
333 if( $element->getRandomIdentifier() != $this->getRandomIdentifier() )
334 {
335 return false;
336 }
337
338 if( $element->getSolutionIdentifier() != $this->getSolutionIdentifier() )
339 {
340 return false;
341 }
342
343 if( $element->getPosition() != $this->getPosition() )
344 {
345 return false;
346 }
347
348 if( $element->getIndentation() != $this->getIndentation() )
349 {
350 return false;
351 }
352
353 return true;
354 }

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

+ Here is the call graph for this function:

◆ setContent()

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

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

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

References $content.

◆ setExportIdent()

ilAssOrderingElement::setExportIdent (   $ident)

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

498 {
499 if( $this->isExportIdent($ident) )
500 {
501 list($randomId, $solutionId, $pos, $indent) = explode(
502 self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident
503 );
504
505 $this->setRandomIdentifier($randomId);
506 $this->setSolutionIdentifier($solutionId);
507 $this->setPosition($pos);
508 $this->setIndentation($indent);
509 }
510 }
setRandomIdentifier($randomIdentifier)
setSolutionIdentifier($solutionIdentifier)

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

+ Here is the call graph for this function:

◆ setId()

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

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

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

References $id.

◆ setImagePathFs()

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

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

307 {
308 $this->imagePathFs = $imagePathFs;
309 }

References $imagePathFs.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

+ Here is the caller graph for this function:

◆ setImagePathWeb()

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

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

291 {
292 $this->imagePathWeb = $imagePathWeb;
293 }

References $imagePathWeb.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

+ Here is the caller graph for this function:

◆ setImageRemovalRequest()

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

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

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

References $imageRemovalRequest.

◆ setImageThumbnailPrefix()

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

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

323 {
324 $this->imageThumbnailPrefix = $imageThumbnailPrefix;
325 }

References $imageThumbnailPrefix.

Referenced by ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

+ Here is the caller graph for this function:

◆ setIndentation()

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

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

179 {
180 $this->indentation = $indentation;
181 }

References $indentation.

Referenced by setExportIdent().

+ Here is the caller graph for this function:

◆ setPosition()

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

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

203 {
204 $this->position = $position;
205 }

References $position.

Referenced by setExportIdent().

+ Here is the caller graph for this function:

◆ setRandomIdentifier()

ilAssOrderingElement::setRandomIdentifier (   $randomIdentifier)
Parameters
$randomIdentifier

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

155 {
156 $this->randomIdentifier = $randomIdentifier;
157 }

References $randomIdentifier.

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

+ Here is the caller graph for this function:

◆ setSolutionIdentifier()

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

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

171 {
172 $this->solutionIdentifier = $solutionIdentifier;
173 }

References $solutionIdentifier.

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

+ Here is the caller graph for this function:

◆ setUploadImageFile()

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

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

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

References $uploadImageFile.

◆ setUploadImageName()

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

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

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

References $uploadImageName.

◆ thumbnailFileExists()

ilAssOrderingElement::thumbnailFileExists ( )
protected

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

394 {
395 if( !strlen($this->getContent()) )
396 {
397 return false;
398 }
399
400 return file_exists($this->getThumbnailFilePath());
401 }

References getContent(), and getThumbnailFilePath().

Referenced by getPresentationImageUrl().

+ 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.

Referenced by __clone(), and __construct().

◆ $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: