'y']; protected function _initElements() { parent::_initElements(); $dataObj = new App_People_Admin_Obj(); $image = $dataObj->getConfig('image')->toArray(); $shortBioLength = $dataObj->getConfig('shortBioLength'); $this->addElement('text', 'name', ['label' => 'Name', 'required' => true]); $this->addSeoGroup('People', 'name'); $this->addElement( 'extendedImage', 'image', [ 'label' => 'Photo', 'resize' => $image['width'] . 'x' . $image['height'] . $image['resizeMethodAlias'], 'thumbnailWidth' => $image['width'], 'thumbnailHeight' => $image['height'], ] ); $this->addElement('text', 'jobTitle', ['label' => 'Job Title', 'required' => true]); $this->addElement('email', 'email', ['label' => 'Email']); $this->addElement('phone', 'phone', ['label' => 'Phone']); $this->addElement( 'textarea', 'shortBio', [ 'label' => 'Short Bio', 'rows' => 5, 'description' => 'Text space is limited to ' . $shortBioLength . ' characters.', ] ); $validatorOptions = [ 'max' => $shortBioLength, 'elementLabel' => $this->getElement('shortBio')->getLabel(), ]; $this->getElement('shortBio')->addValidator('StringLength', true, [$validatorOptions]); $this->addElement('htmlEditor', 'fullBio', ['label' => 'Full Bio', 'required' => true]); $socialLinks = \App_People_Admin_Obj::getSocialLinks(); foreach ($socialLinks as $socialLink) { $this->addElement( 'text', 'socialLink' . $socialLink['id'], [ 'label' => $socialLink['serviceName'] . ' Profile Link', 'validators' => ['Url'], 'description' => 'Example: ' . $socialLink['exampleLink'], ] ); } $this->addElement('checkbox', 'enabled', ['label' => 'Show on user end', 'decoration' => 'simple']); return $this; } }