Swat/SwatChangeOrder.php
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $ordered_options = $this->getOrderedOptions();

        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $list_div = new SwatHtmlTag('div');
        $list_div->style = "width: {$this->width}; height: {$this->height};";
        $list_div->id = "{$this->id}_list";
        $list_div->class = 'swat-change-order-list';
        $list_div->open();

        $option_div = new SwatHtmltag('div');
        $option_div->class = 'swat-change-order-item';

        foreach ($ordered_options as $option) {
            $title = $option->title === null ? '' : $option->title;
            $option_div->setContent($title, $option->content_type);
            $option_div->display();
        }

        $list_div->close();

        $this->displayButtons();

        echo '<div class="swat-clear"></div>';

        $values = array();
        foreach ($ordered_options as $option) {
            $values[] = SwatString::signedSerialize(
                $option->value,
                $this->getForm()->getSalt()
            );
        }

        $hidden_tag = new SwatHtmlTag('input');
        $hidden_tag->type = 'hidden';
        $hidden_tag->id = $this->id . '_value';
        $hidden_tag->name = $this->id;
        $hidden_tag->value = implode(',', $values);
        $hidden_tag->display();

        $hidden_items_tag = new SwatHtmlTag('input');
        $hidden_items_tag->type = 'hidden';
        $hidden_items_tag->id = $this->id . '_dynamic_items';
        $hidden_items_tag->value = '';
        $hidden_items_tag->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $ordered_options = $this->getOrderedOptions();

        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $list_div = new SwatHtmlTag('div');
        $list_div->style = "width: {$this->width}; height: {$this->height};";
        $list_div->id = "{$this->id}_list";
        $list_div->class = 'swat-change-order-list';
        $list_div->open();

        $option_div = new SwatHtmltag('div');
        $option_div->class = 'swat-change-order-item';

        foreach ($ordered_options as $option) {
            $title = $option->title === null ? '' : $option->title;
            $option_div->setContent($title, $option->content_type);
            $option_div->display();
        }

        $list_div->close();

        $this->displayButtons();

        echo '<div class="swat-clear"></div>';

        $values = array();
        foreach ($ordered_options as $option) {
            $values[] = SwatString::signedSerialize(
                $option->value,
                $this->getForm()->getSalt()
            );
        }

        $hidden_tag = new SwatHtmlTag('input');
        $hidden_tag->type = 'hidden';
        $hidden_tag->id = $this->id . '_value';
        $hidden_tag->name = $this->id;
        $hidden_tag->value = implode(',', $values);
        $hidden_tag->display();

        $hidden_items_tag = new SwatHtmlTag('input');
        $hidden_items_tag->type = 'hidden';
        $hidden_items_tag->id = $this->id . '_dynamic_items';
        $hidden_items_tag->value = '';
        $hidden_items_tag->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
public function display ( ) { if ( ! $ this -> visible ) { return ; } parent :: display ( ) ; $ ordered_options = $ this -> getOrderedOptions ( ) ; $ div_tag = new SwatHtmlTag ( 'div' ) ; $ div_tag -> id = $ this -> id ; $ div_tag -> class = $ this -> getCSSClassString ( ) ; $ div_tag -> open ( ) ; $ list_div = new SwatHtmlTag ( 'div' ) ; $ list_div -> style = "width: {$this->width}; height: {$this->height};" ; $ list_div -> id = "{$this->id}_list" ; $ list_div -> class = 'swat-change-order-list' ; $ list_div -> open ( ) ; $ option_div = new SwatHtmltag ( 'div' ) ; $ option_div -> class = 'swat-change-order-item' ; foreach ( $ ordered_options as $ option ) { $ title = $ option -> title === null ? '' : $ option -> title ; $ option_div -> setContent ( $ title , $ option -> content_type ) ; $ option_div -> display ( ) ; } $ list_div -> close ( ) ; $ this -> displayButtons ( ) ; echo '<div class="swat-clear"></div>' ; $ values = array ( ) ; foreach ( $ ordered_options as $ option ) { $ values [ ] = SwatString :: signedSerialize ( $ option -> value , $ this -> getForm ( ) -> getSalt ( ) ) ; } $ hidden_tag = new SwatHtmlTag ( 'input' ) ; $ hidden_tag -> type = 'hidden' ; $ hidden_tag -> id = $ this -> id . '_value' ; $ hidden_tag -> name = $ this -> id ; $ hidden_tag -> value = implode ( ',' , $ values ) ; $ hidden_tag -> display ( ) ; $ hidden_items_tag = new SwatHtmlTag ( 'input' ) ; $ hidden_items_tag -> type = 'hidden' ; $ hidden_items_tag -> id = $ this -> id . '_dynamic_items' ; $ hidden_items_tag -> value = '' ; $ hidden_items_tag -> display ( ) ; $ div_tag -> close ( ) ; Swat :: displayInlineJavaScript ( $ this -> getInlineJavaScript ( ) ) ; }
Displays this change-order control
Displays this change - order control