protected function renderControl($type = null, $confirmation = false)
 {
     if ($this->field->value) {
         $this->field->attributes['checked'] = 'checked';
     }
     parent::renderControl($type, $confirmation);
 }
 public function renderControl($type = 'number', $confirmation = false)
 {
     $this->field->attributes['min'] = $this->field->min_value;
     $this->field->attributes['max'] = $this->field->max_value;
     $this->field->attributes['step'] = $this->field->step;
     parent::renderControl($type, $confirmation);
 }
 protected function renderCaption($confirmation = false)
 {
     //Use a div tag instead of a label, as we will be using labels for the individual options
     ob_start();
     parent::renderCaption($confirmation);
     $output = ob_get_clean();
     $output = str_replace('<label', '<div', $output);
     $output = str_replace('</label>', '</div>', $output);
     echo $output;
 }
    public function renderControl($type = null, $confirmation = false)
    {
        if (strpos($this->field->url, '[return]') !== false) {
            $this->field->url = str_replace('[return]', $this->field->parent_field_set->parent_form->return_url, $this->field->url);
        }
        if ($this->field->url) {
            if (!isset($this->field->attributes['onclick'])) {
                $this->field->attributes['onclick'] = '';
            }
            $this->field->attributes['onclick'] .= 'window.location=\'' . $this->field->url . '\';return false;';
        }
        if ($this->field->image) {
            ?>
            <a href="<?php 
            echo $this->field->url;
            ?>
"class="field-control fld-<?php 
            echo $this->field->type;
            ?>
 title="<?php 
            echo $this->field->value;
            ?>
" <?php 
            echo $this->field->css_class;
            ?>
" <?php 
            $this->outputId($confirmation ? 'confirm_' : '');
            $this->outputAttributes($this->field->attributes);
            ?>
>
                <img src="<?php 
            echo $this->field->image;
            ?>
" alt="<?php 
            echo $this->field->value;
            ?>
" border="0" />
                <?php 
            if ($this->field->caption) {
                $caption = $confirmation ? sprintf($this->language->form['fld_confirm_caption'], $this->field->caption) : $this->field->caption;
                echo $caption;
            }
            ?>
            </a>
            <?php 
        } else {
            parent::renderControl('button');
        }
    }
    public function renderControl($type = null, $confirmation = false)
    {
        if ($this->field->getUploadFolder() !== false) {
            $file_name = htmlentities($this->field->getValue());
            if (strlen($file_name) > 0) {
                //File already uploaded to either final destination or staging area - offer to delete
                echo $file_name;
                ?>
                <input type="hidden" name="<?php 
                echo $this->field->name;
                ?>
" value="<?php 
                echo $file_name;
                ?>
" />
                <input type="submit" name="delete_<?php 
                echo $this->field->name;
                ?>
" value="<?php 
                echo $this->language->form['delete'];
                ?>
" />
                <?php 
            } else {
                parent::renderControl();
            }
            ?>
            <input type="hidden" name="orig_<?php 
            echo $this->field->name;
            ?>
" value="<?php 
            echo implode(",", $this->field->orig_file_names);
            ?>
" />
            <?php 
        } else {
            echo $this->language->form['err_fld_file_no_destination'];
        }
    }
    public function postRender()
    {
        ?>
</div><?php 
        parent::postRender();
    }
 protected function loadJsFiles()
 {
     parent::loadJsFiles();
     $this->cms->addJavascript($this->language->routing['bare_entry_url'] . '&resource=js&id=nicedit/nicEdit');
     $this->cms->addStylesheet($this->language->routing['bare_entry_url'] . '&resource=css&id=nicedit/nicedit');
 }
Exemple #8
0
 public function render()
 {
     if (isset($this->renderer)) {
         $this->renderer->render();
     }
 }