/**
  * @inheritDoc IFieldType::getInputHtml()
  *
  * @param string $name
  * @param mixed  $criteria
  *
  * @return string
  */
 public function getInputHtml($name, $criteria)
 {
     try {
         return parent::getInputHtml($name, $criteria);
     } catch (InvalidSubpathException $e) {
         return '<p class="warning">' . '<span data-icon="alert"></span> ' . Craft::t('This field’s target subfolder path is invalid: {path}', array('path' => '<code>' . $this->getSettings()->singleUploadLocationSubpath . '</code>')) . '</p>';
     }
 }
 /**
  * @inheritDoc IFieldType::getInputHtml()
  *
  * @param string $name
  * @param mixed  $criteria
  *
  * @return string
  */
 public function getInputHtml($name, $criteria)
 {
     // Make sure the field is set to a valid category group
     $sourceKey = $this->getSettings()->source;
     if ($sourceKey) {
         $source = $this->getElementType()->getSource($sourceKey, 'field');
     }
     if (empty($source)) {
         return '<p class="error">' . Craft::t('This field is not set to a valid category group.') . '</p>';
     }
     return parent::getInputHtml($name, $criteria);
 }
 /**
  * @inheritDoc IFieldType::getInputHtml()
  *
  * @param string $name
  * @param mixed  $criteria
  *
  * @return string
  */
 public function getInputHtml($name, $criteria)
 {
     return BaseElementFieldType::getInputHtml($name, $criteria);
 }
示例#4
0
 /**
  * @inheritDoc IFieldType::getInputHtml()
  *
  * @param string $name
  * @param mixed  $criteria
  *
  * @return string
  */
 public function getInputHtml($name, $criteria)
 {
     try {
         return parent::getInputHtml($name, $criteria);
     } catch (InvalidSubpathException $e) {
         return '<p class="warning">' . '<span data-icon="alert"></span> ' . Craft::t('This field’s target subfolder path is invalid: {path}', array('path' => '<code>' . $this->getSettings()->singleUploadLocationSubpath . '</code>')) . '</p>';
     } catch (InvalidSourceException $e) {
         $message = $this->getSettings()->useSingleFolder ? Craft::t('This field’s single upload location Assets Source is missing') : Craft::t('This field’s default upload location Assets Source is missing');
         return '<p class="warning">' . '<span data-icon="alert"></span> ' . $message . '</p>';
     }
 }