protected function buildForm()
 {
     $form = $this->formBuilder;
     $definitions = [["id" => "company_name", "label" => $this->trans("Your company's name"), "constraints" => []], ["id" => "twitter_company_name", "label" => $this->trans("Your company's name on twitter"), "constraints" => [new Callback(["methods" => [[$this, "verifyValue"]]])]], ["id" => "twitter_creator_name", "label" => $this->trans("The creator's name on twitter"), "constraints" => [new Callback(["methods" => [[$this, "verifyValue"]]])]]];
     foreach ($definitions as $field) {
         $value = ConfigQuery::read("opengraph_" . $field["id"], "");
         $form->add($field["id"], "text", array("constraints" => $field["constraints"], "data" => $value, "label" => $field["label"], "label_attr" => array("for" => $field["id"])))->add("enable_sharing_buttons", "checkbox", array("label" => "Enable the sharing buttons", "label_attr" => ["for" => "enable_sharing_buttons", "help" => Translator::getInstance()->trans('Check if you want to activate the sharing buttons in the front office', [], OpenGraph::DOMAIN_NAME)], "required" => false, "constraints" => array(), "value" => OpenGraph::getConfigValue(OpenGraphConfigValue::ENABLE_SHARING_BUTTONS, 1)));
     }
 }
 public function openGraphSharingButtons(HookRenderEvent $event)
 {
     if (OpenGraph::getConfigValue(OpenGraphConfigValue::ENABLE_SHARING_BUTTONS, 0) == 1) {
         $acceptedTypes = ['category', 'product', 'folder', 'content'];
         $objectType = $this->getView();
         if (in_array($objectType, $acceptedTypes)) {
             $event->add($this->render('open_graph_sharing_button.html', ['view_value' => $objectType]));
         }
     }
 }