private function renamegroup($groupIdentifier, $newGroupIdentifier) { $groupObject = eZContentClassGroup::fetchByName($groupIdentifier, true); if ($groupObject == null) { echo "Invalid group identifier\n"; return; } $date_time = time(); $groupObject->setAttribute("modified", $date_time); $groupObject->setAttribute("modifier_id", false); $groupObject->setAttribute("name", $newGroupIdentifier); $groupObject->store(); eZContentClassClassGroup::update(null, $groupObject->ID, $newGroupIdentifier); echo "Successfully renamed group {$groupIdentifier} to {$newGroupIdentifier}\n"; }
if ($http->hasPostVariable("DiscardButton")) { $Module->redirectTo($Module->functionURI("grouplist")); return; } if ($http->hasPostVariable("StoreButton")) { if ($http->hasPostVariable("Group_name")) { $name = $http->postVariable("Group_name"); } $classgroup->setAttribute("name", $name); // Set new modification date $date_time = time(); $classgroup->setAttribute("modified", $date_time); $user = eZUser::currentUser(); $user_id = $user->attribute("contentobject_id"); $classgroup->setAttribute("modifier_id", $user_id); $classgroup->store(); eZContentClassClassGroup::update(null, $GroupID, $name); $Module->redirectToView('classlist', array($classgroup->attribute('id'))); return; } $Module->setTitle("Edit class group " . $classgroup->attribute("name")); // Template handling $tpl = eZTemplate::factory(); $res = eZTemplateDesignResource::instance(); $res->setKeys(array(array("classgroup", $classgroup->attribute("id")))); $tpl->setVariable("http", $http); $tpl->setVariable("module", $Module); $tpl->setVariable("classgroup", $classgroup); $Result = array(); $Result['content'] = $tpl->fetch("design:class/groupedit.tpl"); $Result['path'] = array(array('url' => '/class/grouplist/', 'text' => ezpI18n::tr('kernel/class', 'Class groups')), array('url' => false, 'text' => $classgroup->attribute('name')));