public function editClassLabel()
    {
        $clazz = $this->getCurrentClass();

        /** @var SignatureGenerator $signatureGenerator */
        $signatureGenerator = ServiceManager::getServiceManager()->get(SignatureGenerator::class);

        $signature = $signatureGenerator->generate(
            tao_helpers_Uri::encode($this->getRequestParameter('classUri'))
        );

        $editClassLabelForm = new tao_actions_form_EditClassLabel(
            $clazz,
            $this->getRequestParameters(),
            $signature
        );

        $myForm = $editClassLabelForm->getForm();

        if ($myForm->isSubmited()) {
            if ($myForm->isValid()) {
                $clazz->setLabel($myForm->getValue(tao_helpers_Uri::encode(OntologyRdfs::RDFS_LABEL)));

                $this->setData("selectNode", tao_helpers_Uri::encode($clazz->getUri()));
                $this->setData('message', __('%s Class saved', $clazz->getLabel()));
                $this->setData('reload', true);
            }
        }

        $this->setData('formTitle', __('Edit class %s', \tao_helpers_Display::htmlize($clazz->getLabel())));
        $this->setData('myForm', $myForm->render());
        $this->setView('form.tpl', 'tao');
    }
public function editClassLabel()
    {
        $clazz = $this->getCurrentClass();

        /** @var SignatureGenerator $signatureGenerator */
        $signatureGenerator = ServiceManager::getServiceManager()->get(SignatureGenerator::class);

        $signature = $signatureGenerator->generate(
            tao_helpers_Uri::encode($this->getRequestParameter('classUri'))
        );

        $editClassLabelForm = new tao_actions_form_EditClassLabel(
            $clazz,
            $this->getRequestParameters(),
            $signature
        );

        $myForm = $editClassLabelForm->getForm();

        if ($myForm->isSubmited()) {
            if ($myForm->isValid()) {
                $clazz->setLabel($myForm->getValue(tao_helpers_Uri::encode(OntologyRdfs::RDFS_LABEL)));

                $this->setData("selectNode", tao_helpers_Uri::encode($clazz->getUri()));
                $this->setData('message', __('%s Class saved', $clazz->getLabel()));
                $this->setData('reload', true);
            }
        }

        $this->setData('formTitle', __('Edit class %s', \tao_helpers_Display::htmlize($clazz->getLabel())));
        $this->setData('myForm', $myForm->render());
        $this->setView('form.tpl', 'tao');
    }
public function editClassLabel ( ) { $ clazz = $ this -> getCurrentClass ( ) ; /** @var SignatureGenerator $signatureGenerator */ $ signatureGenerator = ServiceManager :: getServiceManager ( ) -> get ( SignatureGenerator :: class ) ; $ signature = $ signatureGenerator -> generate ( tao_helpers_Uri :: encode ( $ this -> getRequestParameter ( 'classUri' ) ) ) ; $ editClassLabelForm = new tao_actions_form_EditClassLabel ( $ clazz , $ this -> getRequestParameters ( ) , $ signature ) ; $ myForm = $ editClassLabelForm -> getForm ( ) ; if ( $ myForm -> isSubmited ( ) ) { if ( $ myForm -> isValid ( ) ) { $ clazz -> setLabel ( $ myForm -> getValue ( tao_helpers_Uri :: encode ( OntologyRdfs :: RDFS_LABEL ) ) ) ; $ this -> setData ( "selectNode" , tao_helpers_Uri :: encode ( $ clazz -> getUri ( ) ) ) ; $ this -> setData ( 'message' , __ ( '%s Class saved' , $ clazz -> getLabel ( ) ) ) ; $ this -> setData ( 'reload' , true ) ; } } $ this -> setData ( 'formTitle' , __ ( 'Edit class %s' , \ tao_helpers_Display :: htmlize ( $ clazz -> getLabel ( ) ) ) ) ; $ this -> setData ( 'myForm' , $ myForm -> render ( ) ) ; $ this -> setView ( 'form.tpl' , 'tao' ) ; }
Common action to view and change the label of a class
Common action to view and change the label of a class