Пример #1
0
 function do_edit()
 {
     $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
     if ($link_id === null) {
         $this->errorRedirectToMain(_kt("Please specify a link type to edit."));
     }
     $oLinkType =& LinkType::get($link_id);
     $this->aBreadcrumbs[] = array('name' => _kt('Document Links'));
     $this->oPage->setBreadcrumbDetails(_kt("view"));
     $aLinkTypes =& LinkType::getList('id > 0');
     $editLinkForm = array();
     // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
     $editLinkForm[] = new KTStringWidget(_kt('Name'), _kt('A short, human-readable name for the link type.'), 'fName', $oLinkType->getName(), $this->oPage, true);
     $editLinkForm[] = new KTStringWidget(_kt('Description'), _kt('A short brief description of the relationship implied by this link type.'), 'fDescription', $oLinkType->getDescription(), $this->oPage, true);
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/linktypesadmin');
     $oTemplate->setData(array("context" => $this, "edit_form" => $editLinkForm, "old_link" => $oLinkType, "links" => $aLinkTypes));
     return $oTemplate;
 }