Ejemplo n.º 1
0
 public function getTotalImageRequired()
 {
     $total = 0;
     if ($this->is_male) {
         return $total;
     }
     if ($this->is_only_dmm) {
         $total = Image::IMAGE_PER_SERVER;
     } else {
         $total = Image::IMAGE_PER_SERVER * count(Image::getImageSchemeArray());
     }
     if ($this->has_aw_image) {
         $total++;
     }
     return $total;
 }
Ejemplo n.º 2
0
?>
" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <form enctype="multipart/form-data" class="ws-validate" method="post" role="form" action=<?php 
echo Main::$app->router->pathFor('imageUpload', ['id' => $model->id]);
?>
>
            <input type="hidden" name="MAX_FILE_SIZE" value="2097152" />
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Upload images</h4>
                </div>
                <div class="modal-body">
                    <?php 
foreach (Image::getImageSchemeArray() as $server => $sceneList) {
    foreach ($sceneList as $scene) {
        if ($model->isImageRequired($server, $scene)) {
            echo $this->render('image/ajax/modal-body', ['image' => (object) ['server' => $server, 'scene' => $scene]]);
        }
    }
}
?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">upload images</button>
                </div>
            </div>
        </form>
    </div>