コード例 #1
0
 /**
  * Remove a section.
  * @return Redirect to the index.
  */
 function removeSection()
 {
     $repository = $this->param('repository');
     // Remove the section
     if (lizmap::removeRepository($repository)) {
         // Remove rights on this resource
         $daoright = jDao::get('jacl2db~jacl2rights', 'jacl2_profile');
         $conditions = jDao::createConditions();
         $conditions->addCondition('id_aclres', '=', $repository);
         $nbdeleted = $daoright->deleteBy($conditions);
         jMessage::add(jLocale::get("admin~admin.form.admin_section.message.data.removed") . " " . jLocale::get("admin~admin.form.admin_section.message.data.removed.groups.concerned", array($nbdeleted)));
     } else {
         jMessage::add(jLocale::get("admin~admin.form.admin_section.message.data.removed.failed"), 'error');
     }
     // Redirect to the index
     $rep = $this->getResponse("redirect");
     $rep->action = "admin~config:index";
     return $rep;
 }