Class: ItemAdminService

Source Location: /CORE/system/classes/item/ItemAdminService.php

Class ItemAdminService

Descendants
Child Class Description
FileAdminService The FileAdminService provides all kind of writing services for Files.
ImageAdminService The ImageAdminService provides all kind of writing services for Images.
MenuAdminService Class used for administrating BIGACE "Menu" Items

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From ItemService

ItemService::ItemService()
Initalizes a new ItemService for the given Itemtype.
ItemService::countAllItems()
Counts all Items, except TOP_LEVEL.
ItemService::countLevel()
Calculates the Level beneath TOP LEVEL.
ItemService::getItem()
ItemService::getItemLanguageEnumeration()
ItemService::getItemtype()
ItemService::getLastEditedItems()
Get the last edited Items for the specified Language.
ItemService::getLightTree()
ItemService::getLightTreeForLanguage()
ItemService::getTree()
ItemService::getTreeForLanguage()
ItemService::getTreeWalker()
ItemService::getWayHome()
ItemService::increaseViewCounter()
ItemService::initItemService()
ItemService::isChildOf()
Returns true if "child" is somewhere beneath "parent" in the Menu Tree.
ItemService::isLeaf()
Checks whether the given Item is a Leaf.

Inherited From Itemtype

Itemtype::Itemtype()
Itemtype::getClass()
Itemtype::getClassName()
Itemtype::getCommand()
Itemtype::getDirectory()
Itemtype::getItemtypeID()
Itemtype::initItemtype()

Inherited From MasterItemType

MasterItemType::MasterItemType()
Empty Constructor.
MasterItemType::countItemtypes()
Returns how many Itemtypes are known by the System.
MasterItemType::getClassForItemType()
Returns a new instance of the Class for the given Itentype ID.
MasterItemType::getClassNameForItemType()
Returns the Classname for the given Itentype ID.
MasterItemType::getCommandForItemType()
Return the Command for the given Itemtype ID.
MasterItemType::getDirectoryForItemType()
Return the Directory for the given Itemtype ID.
MasterItemType::getItemTypeForCommand()
Get the Itemtype ID for the given Command (or null).
MasterItemType::getSelectColumns()
Returns the Select Columns to be used for Item- and Treeselects.

[ Top ]
Method Summary
ItemAdminService   ItemAdminService()  
void   addCategoryLink()  
void   buildUniqueName()  
void   buildUniqueNameSafe()  
void   changeItem()   Changes an existing File in the System.
void   changeItemColumnLanguage()  
void   createDataArrayForParent()  
mixed   createItem()   Inserts a new Item, NOT a language version!
void   createLanguageVersion()   Creates a NEW language for the given Item.
void   deleteAllProjectNum()  
void   deleteAllProjectText()  
void   deleteItem()   Deletes an Item from BIGACE, including all Language Versions, its rights and categorys.
int   deleteItemLanguage()   This returns:
AdminRequestResult   getMaxPositionForParentID()   Get the highest Position within the given Tree.
void   initItemAdminService()   Has to be called by implementing classes.
boolean   isAllowed()   Returns whether the uploaded file type is allowed by the System.
void   isSupportedFile()  
boolean   lowerPosition()   Moves the Item a position down.
boolean   moveItem()   Moves an Item to a new Parent ID.
boolean   raisePosition()   Moves the Item a position up.
void   refreshHistoryVersionContent()   Gets the specified History version and uses its Content to replace the Content of the Items published Version.
void   registerAsFile()  
AdminRequestResult   registerUploadedFile()   Registers a File that was posted to the system.
void   removeAllCategoryLinks()  
void   removeCategoryLink()  
mixed   setItemFlag()   $flag must be one of:
boolean   setItemPosition()   Sets the new Item position.
boolean   setParent()   Move an Item to a new Parent.
void   setProjectNum()   Inserts or updates the given numeric project value.
void   setProjectText()   Inserts or updates the given textual project value.
void   updateContent()   Updates the Content in the File that is fetched from Item->getFullURL().
void   updateItemContent()   Overwrite this method to pipe update Calls to your ItemService implementation.
void   updateItemWithUpload()   Updates the given Items Content with the last uploaded File.
void   _changeItemLanguageWithTimestamp()   Executes an Update on the given Item Language Version.

[ Top ]
Methods
Constructor ItemAdminService  [line 64]

  ItemAdminService ItemAdminService( $itemtype  )

Parameters:
   $itemtype: 


[ Top ]
addCategoryLink  [line 396]

  void addCategoryLink( $itemid, $categoryid  )

Parameters:
   $itemid: 
   $categoryid: 


[ Top ]
buildUniqueName  [line 1001]

  void buildUniqueName( $name, $extension  )

Parameters:
   $name: 
   $extension: 


Redefined in descendants as:

[ Top ]
buildUniqueNameSafe  [line 1005]

  void buildUniqueNameSafe( $name, $extension, [ $startCounter = 0], [ &$lastCounter = null]  )

Parameters:
   $name: 
   $extension: 
   $startCounter: 
   &$lastCounter: 


[ Top ]
changeItem  [line 538]

  void changeItem( $id, $languageid, $data  )

Changes an existing File in the System.

THIS METHOD CREATES A DATABASE BACKUP!

Parameters:
   $id: 
   $languageid: 
   $data: 


[ Top ]
changeItemColumnLanguage  [line 1083]

  void changeItemColumnLanguage( $id, $langid, $columnName, $columnValue  )

Parameters:
   $id: 
   $langid: 
   $columnName: 
   $columnValue: 


[ Top ]
createDataArrayForParent  [line 502]

  void createDataArrayForParent( $item  )

Parameters:
   $item: 


[ Top ]
createItem  [line 751]

  mixed createItem( $data  )

Inserts a new Item, NOT a language version!

THIS ONLY INSERTS THE DATABASE ENTRY. IF YOU NEED A FILESYSTEM ENTRY, YOU HAVE TO CREATE IT FIRST AND SUBMIT ITS NAME WITHIN THE PASSED ARRAY.

Check for ($result === false) to know if this worked.

Parameters:
   $data: 

API Tags:
Return:  int the new Item ID or false


[ Top ]
createLanguageVersion  [line 796]

  void createLanguageVersion( $id, $copyLangID, $data  )

Creates a NEW language for the given Item.

Copies the settings from the given Language Version of this Item if they are not passed.

Parameters:
   $id: 
   $copyLangID: 
   $data: 


[ Top ]
deleteAllProjectNum  [line 434]

  void deleteAllProjectNum( $id, $langid  )

Parameters:
   $id: 
   $langid: 


[ Top ]
deleteAllProjectText  [line 444]

  void deleteAllProjectText( $id, $langid  )

Parameters:
   $id: 
   $langid: 


[ Top ]
deleteItem  [line 231]

  void deleteItem( $id, [ $deleteRecursive = false]  )

Deletes an Item from BIGACE, including all Language Versions, its rights and categorys.

If you try to delete the TOP_LEVEL it will return FALSE.

Parameters:
   $id: 
   $deleteRecursive: 


[ Top ]
deleteItemLanguage  [line 146]

  int deleteItemLanguage( $id, $langid  )

This returns:

  • -2 if last language version has childs
  • -1 if item was completely removed,
  • 1 if language version was deleted,
  • 0 if nothing was performed,

Parameters:
   $id: 
   $langid: 

API Tags:
Return:  the deleted Flag, see method description for details


[ Top ]
getMaxPositionForParentID  [line 377]

  AdminRequestResult getMaxPositionForParentID( $parentid, $languageid  )

Get the highest Position within the given Tree.

Will read the childs of the given ParentID and search the highest value. If the returned Result is successful, you get the Max Position by calling

  1. getID()
.

Parameters:
   $parentid: 
   $languageid: 

API Tags:
Return:  the Result


[ Top ]
initItemAdminService  [line 72]

  void initItemAdminService( $itemtype  )

Has to be called by implementing classes.

Parameters:
   $itemtype: 

API Tags:
Access:  protected


[ Top ]
isAllowed  [line 121]

  boolean isAllowed( $file  )

Returns whether the uploaded file type is allowed by the System.

This depends on the File type.

Parameters:
   $file: 

API Tags:
Return:  whether the given File is supported by this Itemtype or not


[ Top ]
isSupportedFile  [line 126]

  void isSupportedFile( $name, [ $mimetype = null]  )

Parameters:
   $name: 
   $mimetype: 


[ Top ]
lowerPosition  [line 345]

  boolean lowerPosition( $id, $langid  )

Moves the Item a position down.

Parameters:
   $id: 
   $langid: 

API Tags:
Return:  whether the Position was changed or not


[ Top ]
moveItem  [line 356]

  boolean moveItem( $itemid, $newParentID  )

Moves an Item to a new Parent ID.

No further check is performed, so make sure, the new Parent is not the Page itself or a child of the current Page!

Parameters:
   $itemid: 
   $newParentID: 

API Tags:
Return:  whether the Page was moved or not


[ Top ]
raisePosition  [line 336]

  boolean raisePosition( $id, $langid  )

Moves the Item a position up.

Parameters:
   $id: 
   $langid: 

API Tags:
Return:  whether the Position was changed or not


[ Top ]
refreshHistoryVersionContent  [line 853]

  void refreshHistoryVersionContent( $itemid, $languageid, $modifiedDate  )

Gets the specified History version and uses its Content to replace the Content of the Items published Version.

The replaced version (the actual one) will become a history version, to make sure no information will be lost.

Parameters:
   $itemid: 
   $languageid: 
   $modifiedDate: 


[ Top ]
registerAsFile  [line 691]

  void registerAsFile( $filename, $content, $data  )

Parameters:
   $filename: 
   $content: 
   $data: 


[ Top ]
registerUploadedFile  [line 642]

  AdminRequestResult registerUploadedFile( Array $file, Array $data  )

Registers a File that was posted to the system.

If your HTML FORM input field for a File looked like that:

  1. <input name="NewFile" type="file">
you can use
  1. $_FILES['NewFile']
to receive this File.

To specify the File setting, pass an Array like this:

  1. array("name" => "foo""description" => "bar""langid" => "LanguageID")

Parameters:
Array   $file:  the File information, which are automatically extracted by the PHP Core
Array   $data:  Information to further specifiy this Item

API Tags:
Return:  the Result for this Upload


[ Top ]
removeAllCategoryLinks  [line 420]

  void removeAllCategoryLinks( $itemid  )

Parameters:
   $itemid: 


[ Top ]
removeCategoryLink  [line 408]

  void removeCategoryLink( $itemid, $categoryid  )

Parameters:
   $itemid: 
   $categoryid: 


[ Top ]
setItemFlag  [line 1046]

  mixed setItemFlag( int $id, string $language, [int $flag = FLAG_NORMAL]  )

$flag must be one of:

  • FLAG_NORMAL
  • FLAG_HIDDEN
  • FLAG_TRASH)

Parameters:
int   $id:  the item id
string   $language:  the item language
int   $flag:  the item flag

API Tags:
Return:  the result: false if update could not be executed.


[ Top ]
setItemPosition  [line 327]

  boolean setItemPosition( long $id, int $position  )

Sets the new Item position.

Parameters:
long   $id:  id the Item ID to set the new position for
int   $position:  position the new Position

API Tags:
Return:  whether the change worked or not


[ Top ]
setParent  [line 1061]

  boolean setParent( $id $id, $newParent $newParent  )

Move an Item to a new Parent.

Parameters:
$id   $id:  the item id to move
$newParent   $newParent:  the new parent (item id) to move item below

API Tags:
Return:  indicates whether the item movement was successful


[ Top ]
setProjectNum  [line 457]

  void setProjectNum( $id, $langid, $key, $value  )

Inserts or updates the given numeric project value.

Parameters:
   $id: 
   $langid: 
   $key: 
   $value: 


[ Top ]
setProjectText  [line 472]

  void setProjectText( $id, $langid, $key, $value  )

Inserts or updates the given textual project value.

Parameters:
   $id: 
   $langid: 
   $key: 
   $value: 


[ Top ]
updateContent  [line 550]

  void updateContent( $id, $langid, $content, [ $data = array()]  )

Updates the Content in the File that is fetched from Item->getFullURL().

If the file does not exists it will simply create it.

THIS METHOD CREATES A FILESYSTEM AND A DATABASE BACKUP!

Parameters:
   $id: 
   $langid: 
   $content: 
   $data: 


[ Top ]
updateItemContent  [line 575]

  void updateItemContent( $id, $langid, $content, [ $data = array()]  )

Overwrite this method to pipe update Calls to your ItemService implementation.

Parameters:
   $id: 
   $langid: 
   $content: 
   $data: 


Redefined in descendants as:

[ Top ]
updateItemWithUpload  [line 585]

  void updateItemWithUpload( $id, $file, $languageID  )

Updates the given Items Content with the last uploaded File.

THIS METHOD CREATES A FILESYSTEM AND A DATABASE BACKUP!

Parameters:
   $id: 
   $file: 
   $languageID: 


[ Top ]
_changeItemLanguageWithTimestamp  [line 1106]

  void _changeItemLanguageWithTimestamp( $id, $langid, $values, $timestamp  )

Executes an Update on the given Item Language Version.

Parameters:
   $id: 
   $langid: 
   $values: 
   $timestamp: 

API Tags:
Access:  protected


[ Top ]