Ejemplo n.º 1
0
 public function headline()
 {
     if (!$this->readonly) {
         $fieldName = $this->name;
         $blueprint = blueprint::find($this->page());
         $fieldsets = $blueprint->fields()->{$fieldName}->fieldsets;
         $addDropdownHtml = '<div class="drop-down">';
         $addDropdownHtml .= '<a class="drop-down-toggle label-option"><i class="icon icon-left fa fa-chevron-circle-down"></i>' . l('fields.structure.add') . '</a>';
         $addDropdownHtml .= '<ul>';
         foreach ($fieldsets as $fieldsetName => $fieldsetFields) {
             $addDropdownHtml .= '<li>';
             $addDropdownHtml .= '<a href="#0" class="builder-add-button" data-fieldset="' . $fieldsetName . '"><i class="icon icon-left fa fa-plus-circle"></i>' . $fieldsetFields['label'] . '</a>';
             $addDropdownHtml .= '</li>';
         }
         $addDropdownHtml .= '</ul>';
         $addDropdownHtml .= '</div>';
     } else {
         $addButtons[] = null;
     }
     $label = parent::label();
     $label->addClass('builder-label');
     // foreach ($addButtons as $key => $value) {
     //   $label->append($add[$key]);
     // }
     $label->append($addDropdownHtml);
     return $label;
 }
Ejemplo n.º 2
0
 public function headline()
 {
     if (!$this->readonly) {
         /*  $fieldName = $this->name;
               $blueprint = $this->page()->blueprint();
         	$fieldsets = $blueprint->fields($this)->$fieldName->fieldsets;*/
         $fieldsets = $this->fieldsets();
         $add = new Brick('a');
         $add->html('<i class="icon icon-left fa fa-chevron-circle-down"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->data('modal', true);
         $dropDown = new Brick("div");
         $dropDown->addClass('builder-drop-down');
         $addList = new Brick('ul');
         $addList->addClass('builder-add-list');
         foreach ($fieldsets as $fieldsetName => $fieldsetFields) {
             $addListItem = new Brick('li');
             $addListItemLink = new Brick('a');
             $addListItemLink->html('<i class="icon icon-left fa fa-plus-circle"></i>' . $fieldsetFields['label']);
             $addListItemLink->addClass('builder-add-button');
             $addListItemLink->data('modal', true);
             $addListItemLink->attr('href', purl($this->page, 'field/' . $this->name . '/builder/add?fieldset=' . $fieldsetName));
             $addListItem->append($addListItemLink);
             $addList->append($addListItem);
         }
         $dropDown->append($addList);
     } else {
         $addList = null;
         $add = null;
     }
     $label = BaseField::label();
     $label->append($add);
     $label->append($dropDown);
     return $label;
 }
Ejemplo n.º 3
0
 public function headline()
 {
     $add = new Brick('a');
     $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
     $add->addClass('structure-add-button label-option');
     $add->attr('#');
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
Ejemplo n.º 4
0
 public function headline()
 {
     if (!$this->readonly) {
         $add = new Brick('div');
         $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->attr(array("v-on:click" => "addEntrie"));
     } else {
         $add = null;
     }
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
Ejemplo n.º 5
0
 /**
  * Generate label markup
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function label()
 {
     /* Label */
     $label = parent::label();
     /**
      * Fields don't have to have a label assigned.
      * With this, we deal with missing label information.
      *
      * @since 1.3.0
      */
     if (!is_null($label)) {
         $label->addClass('figure-label');
         //$label->append($action);
         return $label;
     }
     return;
 }
Ejemplo n.º 6
0
 /**
  * Generate label markup
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function label()
 {
     /* Action button */
     /*$action = new Brick('a');
       $action->addClass('file-add-button label-option');
       $action->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l::get('bild-zufuegen'));
       $action->attr('href', purl($this->page(), 'upload'));*/
     /* Label */
     $label = parent::label();
     /**
      * Fields don't have to have a label assigned.
      * With this, we deal with missing label information.
      *
      * @since 1.3.0
      */
     if (!is_null($label)) {
         $label->addClass('figure-label');
         //$label->append($action);
         return $label;
     }
     return;
 }
Ejemplo n.º 7
0
 /**
  * Generate label markup
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function label()
 {
     /* Action button */
     $action = new Brick('a');
     $action->addClass('file-add-button label-option');
     $action->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('pages.show.files.add'));
     $action->attr('href', purl($this->page(), 'upload'));
     /* Label */
     $label = parent::label();
     $label->addClass('figure-label');
     $label->append($action);
     return $label;
 }
Ejemplo n.º 8
0
 public function label()
 {
     return parent::label();
 }
Ejemplo n.º 9
0
 /**
  * Generate label markup.
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function label()
 {
     /* Edit button */
     $edit = new Brick('a');
     $edit->addClass('file-edit-button label-option');
     $edit->html('<i class="icon icon-left fa fa-pencil"></i>' . l('pages.show.files.edit'));
     $edit->attr('href', $this->page()->url('files'));
     /* Add button */
     $add = new Brick('a');
     $add->addClass('file-add-button label-option');
     $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('pages.show.files.add'));
     /**
      * FIX: With Kirby 2.2 the structure of the "Add file" actions changed.
      * Let's make sure we handle both the old >2.1 and the new 2.2+ ways.
      *
      * @since 1.5.0
      */
     if (version_compare(Kirby::version(), '2.2', '>=')) {
         $add->attr('href', '#upload');
         $add->data('upload', 'true');
     } else {
         $add->attr('href', purl($this->page(), 'upload'));
     }
     /* Actions container */
     $actions = new Brick('span');
     $actions->addClass('hgroup-option-right selector-hgroup-option-right');
     $actions->append($edit);
     $actions->append($add);
     /* Label */
     $label = parent::label();
     /**
      * FIX: Fields don't have to have a label assigned.
      * With this, we deal with missing label information.
      *
      * @since 1.3.0
      */
     if (!is_null($label)) {
         $label->addClass('figure-label');
         $label->append($actions);
         return $label;
     }
     return;
 }
Ejemplo n.º 10
0
 public function headline()
 {
     if (!$this->readonly) {
         $add = new Brick('a');
         $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->data('modal', true);
         $add->attr('href', purl($this->model, 'field/' . $this->name . '/structure/add'));
     } else {
         $add = null;
     }
     // make sure there's at least an empty label
     if (!$this->label) {
         $this->label = '&nbsp;';
     }
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
Ejemplo n.º 11
0
 public function headline()
 {
     $label = BaseField::label();
     return $label;
 }
Ejemplo n.º 12
0
 public function headline()
 {
     // get entries
     $entries = $this->entries();
     // check if limit is either null or the number of entries less than limit
     if (!$this->readonly && (is_null($this->limit) || is_int($this->limit) && $entries->count() < $this->limit)) {
         $add = new Brick('a');
         $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->data('modal', true);
         $add->attr('href', purl($this->model, 'field/' . $this->name . '/structure/add'));
     } else {
         $add = null;
     }
     // make sure there's at least an empty label
     if (!$this->label) {
         $this->label = '&nbsp;';
     }
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
Ejemplo n.º 13
0
 /**
  * Generate label markup
  *
  * @return string
  */
 public function label()
 {
     $label = parent::label();
     $label->addClass('hgroup-title');
     return $label;
 }