<?php
$this->load_template('_header.php');
$this->load_template('_top.php');
?>
<script>
var txt_norequest = '<?php echo $this->lang('global_txt_no_request') ?>';
var txt_msgalertdelete = '<?php echo $this->lang('dashboard_myalbums_txt_msgalertdelete') ?>';
</script>
<script type="text/javascript" src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/js/js_dashboard.js"></script>
<div id="generalspace">
        
    <div id="container">
    
    	<div id="column1"><?php $this->load_template('_verticalmenu-dashboard.php'); ?></div>
        
        <div id="column2">
		
            <div id="dashboard2">

				<div class="boxdash">                    
    
                    <div class="title"><?php echo $this->lang('dashboard_myalbums_title'); ?></div>
                    
					<div class="spaceinfo">
                    
                    	<div id="msgok" class="hide mrg30B">
                        	<div class="txtsize02 bold grey2"><?php echo $this->lang('dashboard_myalbums_ok_msg01')?></div>
                        	<div class="mrg10T"><?php echo $this->lang('dashboard_myalbums_ok_msg02')?></div>
                        	<div class="mrg10T"><span class="linkblue2 bold"><a href="#" id="linkaddphotos"><?php echo $this->lang('dashboard_myalbums_ok_addphotos')?></a></span> <span class="mrg10L linkblue2 bold"><a href="<?php echo $C->SITE_URL?>dashboard/myalbums"><?php echo $this->lang('dashboard_myalbums_ok_finish')?></a></span></div>
                        </div>
                    
                        <div id="formadd" class="hide">
                        	<div class="editarea">
                                    
                                <div class="subtitle"><?php echo $this->lang('dashboard_myalbums_txt_createalbum'); ?></div>
            
                                <div id="form01" class="mrg30B">
                                    <form id="form1" name="form1" method="post" action="">
                                    <div class="mrg10T grey1"><?php echo $this->lang('dashboard_myalbums_txt_namealbum')?>:</div>
                                    <div><input name="namealbum" type="text" id="namealbum" class="boxinput withbox"/></div>

                                    <div class="mrg10T grey1"><?php echo $this->lang('dashboard_myalbums_txt_descriptionalbum')?>:</div>
                                    <div><textarea name="descriptionalbum" rows="3" class="boxinput withbox" id="descriptionalbum"></textarea></div>

                                    <div class="mrg10T grey1"><?php echo $this->lang('dashboard_myalbums_txt_privacy')?></div>
                                    <div><select name="privacy" id="privacy" class="boxinput withbox">
                                      <option value="0"><?php echo $this->lang('dashboard_myalbums_txt_public')?></option>
                                      <option value="1"><?php echo $this->lang('dashboard_myalbums_txt_friends')?></option>
                                      <option value="2"><?php echo $this->lang('dashboard_myalbums_txt_onlyme')?></option>
                                    </select></div>

                                    <div id="msgerror" class="redbox"></div>
                                    <div class="mrg10T mrg5B">
                                        <span><input type="submit" name="bsave" id="bsave" value="<?php echo $this->lang('dashboard_myalbums_txt_bsave')?>" class="bblue hand"/></span> <span id="lcancelf" class="mrg20L onlyblue hand"><?php echo $this->lang('dashboard_myalbums_txt_cancel'); ?></span>
                                    </div>
              
                                  </form>
                                </div>
                        
                            </div>
                        </div>

						<?php if ($D->numalbums == 0) { ?>
                        
                        <div id="spacelink" class="mrg30B centered">
                            <div class="mrg20T txtsize00 mrg20B"><?php echo $this->lang('dashboard_myalbums_noalbums'); ?></div>
                            <div><span id="linkadd" class="onlyblue bold hand"><?php echo $this->lang('dashboard_myalbums_txt_createalbum')?></span></div>
                        </div>
                        
                        <?php } else { ?>
                        
                        <div id="spacelink" class="mrg20B mrg10T tright mrg10R">
                            <span id="linkadd" class="onlyblue bold hand"><?php echo $this->lang('dashboard_myalbums_txt_createalbum')?></span>
                        </div>
                        
                        <div>
							<?php echo $D->htmlAlbums?>
                            <div class="sh"></div>
                        </div>
                        
                        <?php } ?>

						<script>
                        $('#linkadd').click(function(){
                            $('#spacelink').slideUp('low',function(){
                                $('#formadd').slideDown('low');
                            });
                        })

                        $('#lcancelf').click(function(){
                            $('#formadd').slideUp('low',function(){
                                $('#spacelink').slideDown('low');
                            });
                        })
                        
                        var txt_error_namealbum='<?php echo $this->lang('dashboard_myalbums_error_namealbum')?>';
                        $('#bsave').click(function(){
                            createAlbum('#msgerror', '#msgok', '#formadd', '#bsave');
                            return false;
                        });

                        </script>
                        
                        
                        <?php if ($D->totalalbums>$D->numalbums) { ?>
                        
                        <div id="moreitems"></div>
                        <div class="sh"></div>
                        
                        <div><input name="numitems" type="hidden" id="numitems" value="<?php echo $D->numalbums?>" /></div>
                        
                        <div id="moreitemsbar" class="mrg20T mrg30B">
                            <div class="centered">
                                <span id="bmore" class="bgrey2 rounded"><?php echo $this->lang('global_txt_moreitems')?></span>
                                <span id="morepreload" class="hide"><img src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/imgs/preload.gif" /></span>
                            </div>
                        </div>
                        <script>
                            var idu = <?php echo $this->user->id ?>;
                            var itemperpage = <?php echo $C->NUM_ALBUMS_PAGE ?>;
                            $('#bmore').click(function(){
                                reloadinfo('albums')
                                return false;
                            });
                        </script>
                
                        <?php } ?>

					</div>

				</div>

            </div>
        
        
        </div>
        
        <div id="divseparator" class="sh"></div>
        
        <div id="column3"><?php $this->load_template('_accessories-dashboard.php'); ?></div>
        
        <div class="sh"></div>
    
    </div>
            
</div>    

<?php
$this->load_template('_foot.php');
$this->load_template('_footer.php');
?>