Exemplo n.º 1
0
 /**
  * Returns the label of a field in an element
  *
  * @param string $elementKey Key of Element
  * @param string $fieldKey Key of Field
  * @param array $field whole field, to better determine correct label
  * @param string $table tt_content or pages, to better determine correct label
  * @return string Label
  * @author Benjamin Butschell bb@webprofil.at>
  */
 public function render($elementKey, $fieldKey, $field = NULL, $table = NULL)
 {
     $this->utility = new \MASK\Mask\Utility\MaskUtility($this->objectManager);
     // if we have the whole field configuration
     if ($field) {
         // check if this field is in an repeating field
         if ($field["inlineParent"]) {
             // if yes, the label is in the configuration
             $label = $field["label"];
         } else {
             // otherwise the type can only be tt_content or pages
             if ($table) {
                 // if we have table param, the type must be the table
                 $type = $table;
             } else {
                 // otherwise try to get the label, set param $excludeInlineFields to true
                 $type = $this->utility->getFieldType($fieldKey, $elementKey, true);
             }
             $label = $this->utility->getLabel($elementKey, $fieldKey, $type);
         }
     } else {
         // if we don't have the field configuration, try the best to fetch the type and the correct label
         $type = $this->utility->getFieldType($fieldKey, $elementKey, false);
         $label = $this->utility->getLabel($elementKey, $fieldKey, $type);
     }
     return $label;
 }
Exemplo n.º 2
0
 /**
  * Returns the label of a field in an element
  *
  * @param string $elementKey Key of Element
  * @param string $fieldKey Key if Field
  * @param array $field
  * @return string Label
  * @author Benjamin Butschell bb@webprofil.at>
  */
 public function render($elementKey, $fieldKey, $field = NULL)
 {
     $this->utility = new \MASK\Mask\Utility\MaskUtility($this->objectManager);
     $type = $this->utility->getFieldType($fieldKey, $elementKey);
     if ($field) {
         if ($field["inlineParent"]) {
             $label = $field["label"];
         } else {
             $label = $this->utility->getLabel($elementKey, $fieldKey, $type);
         }
     } else {
         $label = $this->utility->getLabel($elementKey, $fieldKey, $type);
     }
     return $label;
 }
Exemplo n.º 3
0
 /**
  * Checks if a $evalValue is set in a field
  *
  * @param string $fieldKey TCA Type
  * @param string $elementKey TCA Type
  * @param string $evalValue value to search for
  * @param array $field
  * @return boolean $evalValue is set
  * @author Benjamin Butschell bb@webprofil.at>
  */
 public function render($fieldKey, $elementKey, $evalValue, $field = NULL)
 {
     $this->utility = new \MASK\Mask\Utility\MaskUtility($this->objectManager);
     if ($field) {
         if ($field["inlineParent"]) {
             $type = $field["inlineParent"];
             $fieldKey = "tx_mask_" . $field["key"];
         } else {
             $type = $this->utility->getFieldType($fieldKey, $elementKey);
         }
     } else {
         $type = $this->utility->getFieldType($fieldKey, $elementKey);
     }
     return $this->utility->isEvalValueSet($fieldKey, $evalValue, $type);
 }
Exemplo n.º 4
0
 /**
  * Returns all elements that use this field
  *
  * @param string $key TCA Type
  * @param string $elementKey Key of the element
  * @return array elements in use
  * @author Benjamin Butschell bb@webprofil.at>
  */
 public function render($key, $elementKey)
 {
     $this->utility = new \MASK\Mask\Utility\MaskUtility($this->objectManager);
     $type = $this->utility->getFieldType($key, $elementKey);
     return $this->utility->getElementsWhichUseField($key, $type);
 }
Exemplo n.º 5
0
 /**
  * Checks if a $evalValue is set in a field
  *
  * @param string $fieldKey TCA Type
  * @param string $elementKey key of the element
  * @param string $evalValue value to search for
  * @return boolean $evalValue is set
  * @author Benjamin Butschell bb@webprofil.at>
  */
 public function render($fieldKey, $elementKey, $evalValue)
 {
     $this->utility = new \MASK\Mask\Utility\MaskUtility($this->objectManager);
     $type = $this->utility->getFieldType($fieldKey, $elementKey);
     return $this->utility->isBlindLinkOptionSet($fieldKey, $evalValue, $type);
 }