Пример #1
0
    function renderAvailable()
    {
        ob_start();
        ?>
        <?php 
        $schema = new Elite_Vaf_Model_Schema();
        $levels = $schema->getLevels();
        foreach ($levels as $level) {
            ?>
            <div class="multiTree-selectContainer" >
                <?php 
            echo ucfirst($this->htmlEscape($level));
            ?>
:<br />
                <?php 
            $metadata = "{level:'{$level}', parent:'" . $schema->getPrevLevel($level) . "', parents:'" . implode(',', $schema->getPrevLevels($level)) . "',  parents_including:'" . implode(',', $schema->getPrevLevelsIncluding($level)) . "' }";
            ?>
                <select class="multiTree-select <?php 
            echo $level;
            ?>
Select <?php 
            echo $metadata;
            ?>
" multiple="multiple">
                    <?php 
            if ($schema->getRootLevel() == $level) {
                foreach ($this->listEntities($schema->getRootLevel()) as $entity) {
                    ?>
                            <option value="<?php 
                    echo $entity->getId();
                    ?>
"><?php 
                    echo $entity->getTitle();
                    ?>
</option>
                            <?php 
                }
            }
            ?>
                </select>
                <br />
                Quick Add:
                <br />
                <input type="text" class="vafQuickAdd vafQuickAdd_<?php 
            echo $level;
            ?>
 {level:'<?php 
            echo $level;
            ?>
'}" name="vafQuickAdd_<?php 
            echo $level;
            ?>
" />
                <input type="button" class="vafQuickAddSubmit vafQuickAddSubmit_<?php 
            echo $level;
            ?>
 {level:'<?php 
            echo $level;
            ?>
'}" name="vafQuickAddSubmit_<?php 
            echo $level;
            ?>
" value="+" />
                <br />
                <span class="multiTree-levelName" style="display:none;"><?php 
            echo $level;
            ?>
</span>
            </div>
            <?php 
        }
        ?>
        <input class="multiTree-Add" type="button" value="Add +" />
        <?php 
        return ob_get_clean();
    }