Class: ItemAdminService
Source Location: /CORE/system/classes/item/ItemAdminService.php
Class ItemAdminService
Inherited Properties, Constants, and Methods
Method Summary
| void |
changeItem() |
Changes an existing File in the System. |
| mixed |
createItem() |
Inserts a new Item, NOT a language version! |
| void |
deleteItem() |
Deletes an Item from BIGACE, including all Language Versions, its rights and categorys. |
| boolean |
isAllowed() |
Returns whether the uploaded file type is allowed by the System. |
| boolean |
moveItem() |
Moves an Item to a new Parent ID. |
| void |
refreshHistoryVersionContent() |
Gets the specified History version and uses its Content to replace the Content of the Items published Version. |
| 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. |
Methods
ItemAdminService ItemAdminService(
$itemtype
)
|
|
Parameters:
void addCategoryLink(
$itemid,
$categoryid
)
|
|
Parameters:
void buildUniqueName(
$name,
$extension
)
|
|
Parameters:
Redefined in descendants as:
void buildUniqueNameSafe(
$name,
$extension, [
$startCounter = 0], [
&$lastCounter = null]
)
|
|
Parameters:
|
|
$name: |
|
|
|
$extension: |
|
|
|
$startCounter: |
|
|
|
&$lastCounter: |
|
void changeItem(
$id,
$languageid,
$data
)
|
|
Changes an existing File in the System.
THIS METHOD CREATES A DATABASE BACKUP!
Parameters:
void changeItemColumnLanguage(
$id,
$langid,
$columnName,
$columnValue
)
|
|
Parameters:
|
|
$id: |
|
|
|
$langid: |
|
|
|
$columnName: |
|
|
|
$columnValue: |
|
void createDataArrayForParent(
$item
)
|
|
Parameters:
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:
API Tags:
| Return: | int the new Item ID or false |
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:
void deleteAllProjectNum(
$id,
$langid
)
|
|
Parameters:
void deleteAllProjectText(
$id,
$langid
)
|
|
Parameters:
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:
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:
API Tags:
| Return: | the deleted Flag, see method description for details |
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 getID()
.
Parameters:
API Tags:
void initItemAdminService(
$itemtype
)
|
|
Has to be called by implementing classes.
Parameters:
API Tags:
boolean isAllowed(
$file
)
|
|
Returns whether the uploaded file type is allowed by the System.
This depends on the File type.
Parameters:
API Tags:
| Return: | whether the given File is supported by this Itemtype or not |
void isSupportedFile(
$name, [
$mimetype = null]
)
|
|
Parameters:
boolean lowerPosition(
$id,
$langid
)
|
|
Moves the Item a position down.
Parameters:
API Tags:
| Return: | whether the Position was changed or not |
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:
API Tags:
| Return: | whether the Page was moved or not |
boolean raisePosition(
$id,
$langid
)
|
|
Moves the Item a position up.
Parameters:
API Tags:
| Return: | whether the Position was changed or not |
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: |
|
void registerAsFile(
$filename,
$content,
$data
)
|
|
Parameters:
|
|
$filename: |
|
|
|
$content: |
|
|
|
$data: |
|
Registers a File that was posted to the system.
If your HTML FORM input field for a File looked like that: <input name="NewFile" type="file">
you can use $_FILES['NewFile']
to receive this File.To specify the File setting, pass an Array like this: 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 |
void removeAllCategoryLinks(
$itemid
)
|
|
Parameters:
void removeCategoryLink(
$itemid,
$categoryid
)
|
|
Parameters:
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. |
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 |
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 |
void setProjectNum(
$id,
$langid,
$key,
$value
)
|
|
Inserts or updates the given numeric project value.
Parameters:
|
|
$id: |
|
|
|
$langid: |
|
|
|
$key: |
|
|
|
$value: |
|
void setProjectText(
$id,
$langid,
$key,
$value
)
|
|
Inserts or updates the given textual project value.
Parameters:
|
|
$id: |
|
|
|
$langid: |
|
|
|
$key: |
|
|
|
$value: |
|
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: |
|
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:
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:
void _changeItemLanguageWithTimestamp(
$id,
$langid,
$values,
$timestamp
)
|
|
Executes an Update on the given Item Language Version.
Parameters:
|
|
$id: |
|
|
|
$langid: |
|
|
|
$values: |
|
|
|
$timestamp: |
|
API Tags:
|
|