/**
  * rootnavigationAction
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function rootnavigationAction()
 {
     $this->core->logger->debug('global->controllers->NavigationController->rootnavigationAction()');
     $objRequest = $this->getRequest();
     $intCurrLevel = $objRequest->getParam("currLevel");
     $this->setRootLevelId($objRequest->getParam("rootLevelId"));
     $intRootLevelGroupId = $objRequest->getParam('rootLevelGroupId');
     $strRootLevelGroupKey = $objRequest->getParam('rootLevelGroupKey', 'content');
     if (Security::get()->isAllowed(Security::RESOURCE_ROOT_LEVEL_PREFIX . $this->intRootLevelId, Security::PRIVILEGE_VIEW, true, false)) {
         /**
          * get navigation
          */
         $this->getModelFolders();
         $objRootelements = $this->objModelFolders->loadGlobalRootNavigation($this->intRootLevelId, $intRootLevelGroupId);
         $this->view->assign('rootelements', $objRootelements);
         $this->view->assign('currLevel', $intCurrLevel);
         $this->view->assign('folderFormDefaultId', $this->core->sysConfig->form->ids->folders->default);
         $this->view->assign('elementFormDefaultId', $this->core->sysConfig->global_types->{$strRootLevelGroupKey}->default_formId);
         $this->view->assign('elementTemplateDefaultId', $this->core->sysConfig->global_types->{$strRootLevelGroupKey}->default_templateId);
         $this->view->assign('elementTypeDefaultId', $this->core->sysConfig->global_types->{$strRootLevelGroupKey}->id);
         $this->view->assign('rootLevelId', $this->intRootLevelId);
         $this->view->assign('rootLevelGroupId', $intRootLevelGroupId);
         $this->view->assign('rootLevelGroupKey', $strRootLevelGroupKey);
         $this->view->assign('return', true);
     } else {
         $this->view->assign('return', false);
     }
 }
 * include general (autoloader, config)
 */
require_once dirname(__FILE__) . '/../sys_config/general.inc.php';
try {
    $objConsoleOpts = new Zend_Console_Getopt(array('folderId|f=i' => 'Folder Id', 'rootLevelId|r=i' => 'RootLevel Id', 'fromLanguageId|fl=i' => 'From Language Id', 'toLanguageId|tl=i' => 'To Language Id'));
    echo "build tree language variant\n---------------------------\n";
    if (isset($objConsoleOpts->fromLanguageId) && isset($objConsoleOpts->toLanguageId)) {
        echo "load fist level of the tree ...\n";
        require_once GLOBAL_ROOT_PATH . $core->sysConfig->path->zoolu_modules . 'core/models/Folders.php';
        $objModelFolders = new Model_Folders();
        $objModelFolders->setLanguageId($objConsoleOpts->fromLanguageId);
        if (isset($objConsoleOpts->folderId) && $objConsoleOpts->folderId > 0) {
            $objProducts = $objModelFolders->loadGlobalChildNavigation($objConsoleOpts->folderId, $core->sysConfig->root_level_groups->product);
        } else {
            if (isset($objConsoleOpts->rootLevelId) && $objConsoleOpts->rootLevelId > 0) {
                $objProducts = $objModelFolders->loadGlobalRootNavigation($objConsoleOpts->rootLevelId, $core->sysConfig->root_level_groups->product);
            }
        }
        // simulate user auth
        $obj = new stdClass();
        $obj->id = 3;
        //user id
        Zend_Auth::getInstance()->getStorage()->write($obj);
        if (isset($objProducts) && count($objProducts)) {
            buildTreeLanguageVariantNow($objProducts);
        }
    }
    echo "---------------------------\n";
} catch (Exception $exc) {
    echo $exc;
}