diff --git a/include/category.php b/include/category.php index 45b8010..daab5be 100644 --- a/include/category.php +++ b/include/category.php @@ -313,12 +313,28 @@ class Category { return 0; } - function outputEditor() + function objectGetCustomVars($sAction) + { + switch($sAction) + { + case 'add': + return array('iParentId'); + + default: + return null; + } + } + + function outputEditor($aValues = null) { $aCategories = category::getOrderedList(true); $aCatNames = array(); $aCatIds = array(); + $iParentId = $this->iParentId; + if(!$iParentId && $aValues) + $iParentId = getInput('iParentId', $aValues); + foreach($aCategories as $oCategory) { $aCatNames[] = $oCategory->sName; @@ -341,7 +357,7 @@ class Category {
\n"; - echo 'Add'; + echo 'iCatId}\">Add";; if($this->iCatId) // We can't edit the 'Main' category { echo ' ';