Beispiel #1
0
        if (preg_match('/(^[^A-Za-z])|\\W/', $sectionIdentifier)) {
            $errorMessage = ezpI18n::tr('design/admin/section/edit', 'Identifier should consist of letters, numbers or \'_\' with letter prefix.');
        } else {
            $conditions = array('identifier' => $sectionIdentifier, 'id' => array('!=', $SectionID));
            $existingSection = eZSection::fetchFilteredList($conditions);
            if (count($existingSection) > 0) {
                $errorMessage = ezpI18n::tr('design/admin/section/edit', 'The identifier has been used in another section.');
            }
        }
    }
    $section->setAttribute('identifier', $sectionIdentifier);
    $section->setAttribute('navigation_part_identifier', $http->postVariable('NavigationPartIdentifier'));
    if ($http->hasPostVariable('Locale')) {
        $section->setAttribute('locale', $http->postVariable('Locale'));
    }
    if ($errorMessage === '') {
        $section->store();
        eZContentCacheManager::clearContentCacheIfNeededBySectionID($section->attribute('id'));
        $Module->redirectTo($Module->functionURI('list'));
        return;
    } else {
        $tpl->setVariable('error_message', $errorMessage);
    }
}
if ($http->hasPostVariable('CancelButton')) {
    $Module->redirectTo($Module->functionURI('list'));
}
$tpl->setVariable("section", $section);
$Result = array();
$Result['content'] = $tpl->fetch("design:section/edit.tpl");
$Result['path'] = array(array('url' => 'section/list', 'text' => ezpI18n::tr('kernel/section', 'Sections')), array('url' => false, 'text' => $section instanceof eZSection ? $section->attribute('name') : $section['name']));
Beispiel #2
0
        return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
    }
}
if ($http->hasPostVariable('ConfirmRemoveSectionButton')) {
    $currentUser = eZUser::currentUser();
    $accessResult = $currentUser->hasAccessTo('section', 'edit');
    if ($accessResult['accessWord'] == 'yes') {
        if ($http->hasSessionVariable('SectionIDArray')) {
            $sectionIDArray = $http->sessionVariable('SectionIDArray');
            $db = eZDB::instance();
            $db->begin();
            foreach ($sectionIDArray as $sectionID) {
                $section = eZSection::fetch($sectionID);
                if (is_object($section) and $section->canBeRemoved()) {
                    // Clear content cache if needed
                    eZContentCacheManager::clearContentCacheIfNeededBySectionID($sectionID);
                    $section->remove();
                }
            }
            $db->commit();
        }
    } else {
        return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
    }
}
$viewParameters = array('offset' => $offset);
$sectionArray = eZSection::fetchByOffset($offset, $limit);
$sectionCount = eZSection::sectionCount();
$currentUser = eZUser::currentUser();
$allowedAssignSectionList = $currentUser->canAssignSectionList();
$tpl->setVariable("limit", $limit);