Assembla home | Assembla project page
 

Changeset 62

Show
Ignore:
Timestamp:
10/23/06 12:37:17 (2 years ago)
Author:
moensch
Message:

Importing com_mls_seatmap 0.0.2 into trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/com_mls_seatmap/admin.mls_seatmap.html.php

    r60 r62  
    288288        /** ELEMENTS */ 
    289289        function listElements(&$rows, &$pageNav, $search, $category_select, $option, $act) { 
    290                 global $l
     290                global $l, $mosConfig_live_site
    291291                $l->setBlock("elements"); 
     292                $imgbase = $mosConfig_live_site."/components/com_mls_seatmap/images/"; 
    292293                ?> 
    293294                <form action="index2.php" method="post" name="adminForm"> 
     
    306307                <tr> 
    307308                        <th width="20" align="center">#</th> 
     309                        <th width="20" align="center">&nbsp;</th> 
    308310                        <th nowrap="nowrap" width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th> 
    309311                        <th class="title"><?=$l->m("name");?></th> 
     
    327329                                        <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" /> 
    328330                                </td> 
     331                                <td width="20" align="center"><img src="<?=$imgbase;?><?=$row->id;?>_0.png"  /></td> 
    329332                                <td><a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')"><?php echo $row->name; ?></a></td> 
    330333                                <td><?php echo $row->categoryname; ?></td> 
     
    346349                ?> 
    347350                <tr>  
    348                         <th align="center" colspan="8"> <?php echo $pageNav->writePagesLinks(); ?></th> 
    349                 </tr> 
    350                 <tr>  
    351                         <td align="center" colspan="8"> <?php echo $pageNav->writePagesCounter(); ?></td> 
     351                        <th align="center" colspan="9"> <?php echo $pageNav->writePagesLinks(); ?></th> 
     352                </tr> 
     353                <tr>  
     354                        <td align="center" colspan="9"> <?php echo $pageNav->writePagesCounter(); ?></td> 
    352355                </tr> 
    353356                </table> 
     
    362365         
    363366        function editElement(&$row, $lists, $option, $act) { 
    364                 global $l
     367                global $l, $mosConfig_live_site
    365368                $l->setBlock("elements"); 
    366                 ?> 
    367                 <form action="index2.php" method="POST" name="adminForm"> 
     369                $imgbase = $mosConfig_live_site."/components/com_mls_seatmap/images/"; 
     370                ?> 
     371                <form action="index2.php" method="POST" name="adminForm"  enctype="multipart/form-data"> 
    368372                <table cellpadding="4" cellspacing="0" border="0" width="100%"> 
    369373                        <tr>  
     
    374378                        <tr>  
    375379                                <td width="20%" align="right"><?=$l->m("name") ?>:</td> 
    376                                 <td width="20%"><input class="inputbox" type="text" name="name" size="50" maxlength="255" value="<?php echo $row->name; ?>" /></td> 
    377                         </tr> 
    378                         <tr>  
    379                                 <td width="20%" align="right"><?=$l->m("category") ?>:</td> 
    380                                 <td width="20%"><?php echo $lists["categoryid"]; ?></td> 
    381                         </tr> 
    382                         <tr>  
    383                                 <td width="20%" align="right"><?=$l->m("access") ?>:</td> 
    384                                 <td width="20%"><?php echo $lists["access"]; ?></td> 
    385                         </tr> 
    386                         <tr>  
    387                                 <td width="20%" align="right"><?=$l->m("is_free") ?>:</td> 
    388                                 <td width="20%"><?php echo $lists["is_free"]; ?></td> 
    389                         </tr> 
    390                         <tr>  
    391                                 <td width="20%" align="right"><?=$l->m("is_reserved") ?>:</td> 
    392                                 <td width="20%"><?php echo $lists["is_reserved"]; ?></td> 
    393                         </tr> 
    394                         <tr>  
    395                                 <td width="20%" align="right"><?=$l->m("is_occupied") ?>:</td> 
    396                                 <td width="20%"><?php echo $lists["is_occupied"]; ?></td> 
     380                                <td width="80%"><input class="inputbox" type="text" name="name" size="50" maxlength="255" value="<?php echo $row->name; ?>" /></td> 
     381                        </tr> 
     382                        <tr>  
     383                                <td align="right"><?=$l->m("category") ?>:</td> 
     384                                <td><?php echo $lists["categoryid"]; ?></td> 
     385                        </tr> 
     386                        <tr>  
     387                                <td align="right"><?=$l->m("access") ?>:</td> 
     388                                <td><?php echo $lists["access"]; ?></td> 
     389                        </tr> 
     390                        <tr>  
     391                                <td align="right"><?=$l->m("is_free") ?>:</td> 
     392                                <td><?php echo $lists["is_free"]; ?></td> 
     393                        </tr> 
     394                        <tr>  
     395                                <td align="right"><?=$l->m("is_reserved") ?>:</td> 
     396                                <td><?php echo $lists["is_reserved"]; ?></td> 
     397                        </tr> 
     398                        <tr>  
     399                                <td align="right"><?=$l->m("is_occupied") ?>:</td> 
     400                                <td><?php echo $lists["is_occupied"]; ?></td> 
     401                        </tr> 
     402                        <tr>  
     403                                <td colspan="2">&nbsp;</td> 
     404                        </tr> 
     405                        <tr>  
     406                                <td align="right">0&deg;:</td> 
     407                                <td><img src="<?=$imgbase;?><?=$row->id;?>_0.png"  /></td> 
     408                        </tr> 
     409                        <tr>  
     410                                <td align="right">90&deg;:</td> 
     411                                <td><img src="<?=$imgbase;?><?=$row->id;?>_90.png"  /></td> 
     412                        </tr> 
     413                        <tr>  
     414                                <td align="right">180&deg;:</td> 
     415                                <td><img src="<?=$imgbase;?><?=$row->id;?>_180.png"  /></td> 
     416                        </tr> 
     417                        <tr>  
     418                                <td align="right">270&deg;:</td> 
     419                                <td><img src="<?=$imgbase;?><?=$row->id;?>_270.png"  /></td> 
     420                        </tr> 
     421                        <tr> 
     422                                <td align="right"><?=$l->m("upload_image") ?>:</td> 
     423                                <td><input type="file" name="upload_image" class="inputbox" /></td> 
    397424                        </tr> 
    398425                </table> 
     
    424451                <table width="100%" border="0" class="adminform"> 
    425452                        <tr> 
    426                                 <td width="60%" valign="top" rowspan="3" style="border-right: 1px solid black;"> 
     453                                <td width="60%" valign="top" rowspan="4" style="border-right: 1px solid black;"> 
    427454                                <table border="0" cellspacing="1" cellpadding="0"> 
    428455                                        <tr> 
     
    456483                                </td> 
    457484                        </tr> 
     485                         
     486                         
     487                        <tr> 
     488                                <td width="50%" valign="top"> 
     489                                        <?php HTML_MLS_seatmap::editMap_showElementCategories($imgbase); ?> 
     490                                </td> 
     491                        </tr> 
     492                        <tr> 
     493                                <td width="50%" valign="top" height="120"> 
     494                                        <?php HTML_MLS_seatmap::editMap_nameForm(); ?> 
     495                                </td> 
     496                        </tr> 
    458497                        <tr> 
    459498                                <td width="50%" valign="top" height="120"> 
    460499                                        <?php HTML_MLS_seatmap::editMap_ipForm(); ?> 
    461                                 </td> 
    462                         </tr> 
    463                          
    464                         <tr> 
    465                                 <td width="50%" valign="top"> 
    466                                         <?php HTML_MLS_seatmap::editMap_showElementCategories($imgbase); ?> 
    467500                                </td> 
    468501                        </tr> 
     
    481514                global $database, $l, $mosConfig_live_site; 
    482515                $l->setBlock("rooms"); 
    483                 $imgbase = $imgbase ? $imgbase : "../components/".$option."/images/"; 
     516                $imgbase = $imgbase ? $imgbase : $mosConfig_live_site."/components/com_mls_seatmap/images/"; 
    484517                $database->setQuery( "SELECT * FROM `#__mls_seatmap_elements_categories` ORDER BY `name`" ); 
    485518                $rows = $database->loadObjectList(); 
     
    511544         
    512545        function editMap_listElements($categoryid, $cols = 2, $imgbase = '') { 
    513                 global $database, $l
    514                 $imgbase = $imgbase ? $imgbase : "../images/stories/seatmap/"; 
     546                global $database, $l, $mosConfig_live_site
     547                $imgbase = $imgbase ? $imgbase : $mosConfig_live_site."/components/com_mls_seatmap/images/"; 
    515548                $database->setQuery( "SELECT *" 
    516549                                                ."\n FROM `#__mls_seatmap_elements` AS `e`" 
     
    577610                                <td align="center" valign="middle"><?=$l->m("ipblock"); ?></td> 
    578611                                <td width="10"><input type="radio" name="action" value="ipblock" OnClick="setAction('ipblock');" /></td> 
    579                                 <td align="center" valign="middle">&nbsp;</td> 
    580                                 <td width="10">&nbsp;</td> 
    581                 </table> 
    582                 <?php 
    583         } 
     612                                <td align="center" valign="middle"><?=$l->m("nameblock"); ?></td> 
     613                                <td width="10"><input type="radio" name="action" value="nameblock" OnClick="setAction('nameblock');" /></td> 
     614                </table> 
     615                <?php 
     616        } 
     617         
     618        function editMap_nameForm() { 
     619                global $l; 
     620                $l->setBlock("rooms"); 
     621                ?> 
     622                <input type="hidden" name="NAME_FromFirstRow" /> 
     623                <input type="hidden" name="NAME_FromFirstCol" /> 
     624                <input type="hidden" name="NAME_FromSecondRow" /> 
     625                <input type="hidden" name="NAME_FromSecondCol" /> 
     626                <table border="0" class="adminform" width="100%"> 
     627                        <tr> 
     628                                <th colspan="2"><?=$l->m("assign_seat_names"); ?>:</th> 
     629                        </tr> 
     630                                 
     631                        <tr> 
     632                                <td align="right"><?=$l->m("start_at_number"); ?>:<br></td> 
     633                                <td> 
     634                                <input type="text" class="inputbox" name="NAME_start_number" size="3" value="1" /> 
     635                                </td> 
     636                        </tr> 
     637                        <tr> 
     638                                <td align="right"><?=$l->m("prefix"); ?>:<br></td> 
     639                                <td> 
     640                                <input type="text" class="inputbox" name="NAME_prefix" size="3" /> 
     641                                </td> 
     642                        </tr> 
     643                        <tr> 
     644                                <td align="right"><?=$l->m("suffix"); ?>:<br></td> 
     645                                <td> 
     646                                <input type="text" class="inputbox" name="NAME_suffix" size="3" /> 
     647                                </td> 
     648                        </tr> 
     649                        <tr> 
     650                                <td align="right"><?=$l->m("direction"); ?>:<br></td> 
     651                                <td> 
     652                                <select class="inputbox" name="NAME_direction"> 
     653                                <option value="h"><?=$l->m("horizontal"); ?></option> 
     654                                <option value="v" selected><?=$l->m("vertical"); ?></option> 
     655                                </select> 
     656                                </td> 
     657                        </tr> 
     658                        <tr> 
     659                                <td align="right"><input type="button" class="button" name="NAME_reset" value="<?=$l->m("reset"); ?>" onClick="javascript:resetNAMEForm();"></td> 
     660                                <td><input type="button" class="button" name="NAME_submit" value="<?=$l->m("generate"); ?>" onclick="javascript:submitbutton('save_names');"></td> 
     661                        </tr> 
     662                         
     663                </table> 
     664                <?php 
     665        } 
     666         
    584667        function editMap_ipForm() { 
    585668                global $l; 
     
    668751                        <th class="title" width="120"><?=$l->m("event");?></th> 
    669752                        <th class="title" width="120"><?=$l->m("room");?></th> 
     753                        <th width="20"><?=$l->m("name");?></th> 
    670754                        <th width="20"><?=$l->m("row");?></th> 
    671755                        <th width="20"><?=$l->m("col");?></th> 
     
    703787                                <td><?php echo $row->eventname; ?></td> 
    704788                                <td><a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')"><?php echo $row->roomname; ?></a></td> 
     789                                <td align="center"><?php echo $row->name; ?></td> 
    705790                                <td align="center"><?php echo $row->row; ?></td> 
    706791                                <td align="center"><?php echo $row->col; ?></td> 
     
    716801                ?> 
    717802                <tr>  
    718                         <th align="center" colspan="11"> <?php echo $pageNav->writePagesLinks(); ?></th> 
    719                 </tr> 
    720                 <tr>  
    721                         <td align="center" colspan="11"> <?php echo $pageNav->writePagesCounter(); ?></td> 
     803                        <th align="center" colspan="12"> <?php echo $pageNav->writePagesLinks(); ?></th> 
     804                </tr> 
     805                <tr>  
     806                        <td align="center" colspan="12"> <?php echo $pageNav->writePagesCounter(); ?></td> 
    722807                </tr> 
    723808                </table> 
     
    745830                                <td width="20%" align="right"><?=$l->m("room") ?>:</td> 
    746831                                <td width="20%"><?php echo $lists["roomid"]; ?></td> 
     832                        </tr> 
     833                        <tr>  
     834                                <td width="20%" align="right"><?=$l->m("name") ?>:</td> 
     835                                <td width="20%"><input class="inputbox" type="text" name="name" size="10" maxlength="10" value="<?php echo $row->name; ?>" /></td> 
    747836                        </tr> 
    748837                        <tr>  
  • trunk/com_mls_seatmap/admin.mls_seatmap.php

    r60 r62  
    1919} 
    2020 
     21if(file_exists($mosConfig_absolute_path."/administrator/components/".$option."/version")) { 
     22        $act = update; 
     23} 
     24 
    2125switch($act) { 
     26        case "update": 
     27                include($mosConfig_absolute_path."/administrator/components/".$option."/install.".substr($option,4).".php"); 
     28                update(); 
     29                break; 
    2230        case "rooms": 
    2331                switch($task) { 
     
    4957                                saveMap( $option, $act, false ); 
    5058                                saveMapIP( $option, $act ); 
     59                                break; 
     60                        case "save_names": 
     61                                saveMap( $option, $act, false ); 
     62                                saveMapNames( $option, $act ); 
    5163                                break; 
    5264                        default: 
     
    413425        } 
    414426} 
     427 
     428//names 
     429function saveMapNames($option, $act) { 
     430        global $database, $l; 
     431        $l->setBlock("general"); 
     432         
     433        //first, define max row and max col 
     434        if($_POST["NAME_FromFirstRow"] >= $_POST["NAME_FromSecondRow"]) { 
     435                $row_max = $_POST["NAME_FromFirstRow"]; 
     436                $row_min = $_POST["NAME_FromSecondRow"]; 
     437        } else { 
     438                $row_max = $_POST["NAME_FromSecondRow"]; 
     439                $row_min = $_POST["NAME_FromFirstRow"]; 
     440        } 
     441         
     442        if($_POST["NAME_FromFirstCol"] >= $_POST["NAME_FromSecondCol"]) { 
     443                $col_max = $_POST["NAME_FromFirstCol"]; 
     444                $col_min = $_POST["NAME_FromSecondCol"]; 
     445        } else { 
     446                $col_max = $_POST["NAME_FromSecondCol"]; 
     447                $col_min = $_POST["NAME_FromFirstCol"]; 
     448        } 
     449         
     450        $table = $tbl_prefix . "seat_room_elements"; 
     451        $num = $_POST["NAME_start_number"]; 
     452        $names = array(); 
     453        $queries = array(); 
     454        if($_POST["NAME_direction"] == 'h') { 
     455                //increment normal row by row 
     456                for($row_count = $row_min; $row_count <= $row_max; $row_count++) { 
     457                        for($col_count = $col_min; $col_count <= $col_max; $col_count++) { 
     458                                $name = $_POST["NAME_prefix"] . $num . $_POST["NAME_suffix"]; 
     459                                $names[] = $name; 
     460                                $queries[] = "UPDATE `#__mls_seatmap_room_elements` SET `name`='".$name."' WHERE `row`='$row_count' AND `col`='$col_count' AND `roomid`='".$_POST["roomid"]."'"; 
     461                                $num++; 
     462                        } 
     463                } 
     464        } elseif($_POST["NAME_direction"] == 'v') { 
     465                for($col_count = $col_min; $col_count <= $col_max; $col_count++) { 
     466                        for($row_count = $row_min; $row_count <= $row_max; $row_count++) { 
     467                                $name = $_POST["NAME_prefix"] . $num . $_POST["NAME_suffix"]; 
     468                                $names[] = $name; 
     469                                $queries[] = "UPDATE `#__mls_seatmap_room_elements` SET `name`='".$name."' WHERE `row`='$row_count' AND `col`='$col_count' AND `roomid`='".$_POST["roomid"]."'"; 
     470                                $num++; 
     471                        } 
     472                } 
     473        } 
     474         
     475        $database->setQuery( "SELECT `name` FROM `#__mls_seatmap_room_elements` WHERE `name` IN (".implode(",",$names).") ORDER BY `name` ASC" ); 
     476        $database->query(); 
     477        $num = $database->getNumRows(); 
     478        if($num > 0) { 
     479                $message = $num . " " . $l->m("err_of_the") . " " . count($names) . " " . $l->m("err_names_defined_somewhere_else"); 
     480                 
     481                mosRedirect( "index2.php?option=$option&act=$act&mosmsg=".urlencode($message) ); 
     482        } else { 
     483                foreach($queries as $query) { 
     484                        $database->setQuery( $query ); 
     485                        $database->query(); 
     486                } 
     487                mosRedirect( "index2.php?option=$option&act=$act" ); 
     488        } 
     489} 
     490 
    415491function generalChange($cid, $type, $field, $value, $option, $act) { 
    416492        global $database; 
     
    693769 
    694770function saveMLS_seatmap_elements($option,$act) { 
    695         global $database, $my, $mainframe, $l
    696          
     771        global $database, $my, $mainframe, $l, $mosConfig_absolute_path
     772        $imgbase = $mosConfig_absolute_path."/components/com_mls_seatmap/images/"; 
    697773        $row = new mosMLS_seatmap_element( $database ); 
    698774        if (!$row->bind( $_POST )) { 
     
    709785        } 
    710786         
     787        if(strlen($_FILES["upload_image"]["tmp_name"]) > 0) { 
     788                $file = $_FILES["upload_image"]; 
     789                if(eregi('jpeg',$file["type"])) { 
     790                        $im = imagecreatefromjpeg($file["tmp_name"]); 
     791                        if($im) { 
     792                                $new_im = imagecreatetruecolor(13,13); 
     793                        } 
     794                } elseif(eregi('png',$file["type"])) { 
     795                        $im = imagecreatefrompng($file["tmp_name"]); 
     796                        if($im) { 
     797                                $new_im = imagecreatetruecolor(13,13); 
     798                        } 
     799                } 
     800                if($new_im) { 
     801                        imagecopy($new_im,$im,0,0,0,0,13,13); 
     802                        imagepng(ImageRotateRightAngle($new_im,0),$imgbase.$row->id."_0.png"); 
     803                        imagepng(ImageRotateRightAngle($new_im,90),$imgbase.$row->id."_90.png"); 
     804                        imagepng(ImageRotateRightAngle($new_im,180),$imgbase.$row->id."_180.png"); 
     805                        imagepng(ImageRotateRightAngle($new_im,270),$imgbase.$row->id."_270.png"); 
     806                } 
     807        } 
    711808        mosRedirect( "index2.php?option=$option&act=$act" ); 
    712809}; 
    713810 
     811/** 
     812* Rotate an image in multiples of 90 to avoid imagerotate() 
     813* @author Borszczuk on http://php.net/imagerotate 
     814*/ 
     815function ImageRotateRightAngle( $imgSrc, $angle ) { 
     816        // ensuring we got really RightAngle (if not we choose the closest one) 
     817        $angle = min( ( (int)(($angle+45) / 90) * 90), 270 ); 
     818         
     819        // no need to fight 
     820        if( $angle == 0 ) 
     821                return( $imgSrc ); 
     822 
     823        // dimenstion of source image 
     824        $srcX = imagesx( $imgSrc ); 
     825        $srcY = imagesy( $imgSrc ); 
     826         
     827        switch( $angle ) { 
     828                case 90: 
     829                        $imgDest = imagecreatetruecolor( $srcY, $srcX ); 
     830                                for( $x=0; $x<$srcX; $x++ ) 
     831                                        for( $y=0; $y<$srcY; $y++ ) 
     832                                                imagecopy($imgDest, $imgSrc, $srcY-$y-1, $x, $x, $y, 1, 1); 
     833                        break; 
     834                 
     835                case 180: 
     836                        $imgDest = ImageFlip( $imgSrc, IMAGE_FLIP_BOTH ); 
     837                        break; 
     838                 
     839                case 270: 
     840                        $imgDest = imagecreatetruecolor( $srcY, $srcX ); 
     841                        for( $x=0; $x<$srcX; $x++ ) 
     842                                for( $y=0; $y<$srcY; $y++ ) 
     843                                        imagecopy($imgDest, $imgSrc, $y, $srcX-$x-1, $x, $y, 1, 1); 
     844                        break; 
     845        } 
     846        return( $imgDest ); 
     847} 
     848 
     849define("IMAGE_FLIP_HORIZONTAL",    1); 
     850define("IMAGE_FLIP_VERTICAL",    2); 
     851define("IMAGE_FLIP_BOTH",    3); 
     852 
     853/** 
     854* Flip an image to avoid imagerotate() 
     855* @author Borszczuk on http://php.net/imagecopy 
     856*/ 
     857function ImageFlip($imgsrc, $type) { 
     858        $width = imagesx($imgsrc); 
     859        $height = imagesy($imgsrc); 
     860         
     861        $imgdest = imagecreatetruecolor($width, $height); 
     862 
     863        switch( $type ) { 
     864                // mirror wzgl. osi 
     865                case IMAGE_FLIP_HORIZONTAL: 
     866                for( $y=0 ; $y<$height ; $y++ ) 
     867                        imagecopy($imgdest, $imgsrc, 0, $height-$y-1, 0, $y, $width, 1); 
     868                break; 
     869         
     870        case IMAGE_FLIP_VERTICAL: 
     871                for( $x=0 ; $x<$width ; $x++ ) 
     872                        imagecopy($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height); 
     873                break; 
     874         
     875        case IMAGE_FLIP_BOTH: 
     876                for( $x=0 ; $x<$width ; $x++ ) 
     877                        imagecopy($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height); 
     878                         
     879                        $rowBuffer = imagecreatetruecolor($width, 1); 
     880                        for( $y=0 ; $y<($height/2) ; $y++ ) { 
     881                                imagecopy($rowBuffer, $imgdest  , 0, 0, 0, $height-$y-1, $width, 1); 
     882                                imagecopy($imgdest  , $imgdest  , 0, $height-$y-1, 0, $y, $width, 1); 
     883                                imagecopy($imgdest  , $rowBuffer, 0, $y, 0, 0, $width, 1); 
     884                        } 
     885                        imagedestroy( $rowBuffer ); 
     886                break; 
     887        } 
     888        return( $imgdest ); 
     889} 
     890 
     891 
    714892function removeMLS_seatmap_elements($cid,$option,$act) { 
    715         global $database, $my, $mainframe, $l; 
     893        global $database, $my, $mainframe, $l, $mosConfig_absolute_path; 
     894        $imgbase = $mosConfig_absolute_path."/components/com_mls_seatmap/images/"; 
    716895         
    717896        if (count( $cid )) { 
     
    724903                if (!$database->query()) { 
    725904                        echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>\n"; 
     905                } 
     906                foreach($cid as $id) { 
     907                        @unlink($imgbase."/".$id."_0.png"); 
     908                        @unlink($imgbase."/".$id."_90.png"); 
     909                        @unlink($imgbase."/".$id."_180.png"); 
     910                        @unlink($imgbase."/".$id."_270.png"); 
    726911                } 
    727912        } 
  • trunk/com_mls_seatmap/install.mls_seatmap.php

    r60 r62  
    1818        $dep = array("com_mls_lang","com_mls_events"); 
    1919        check_dependencies($dep); 
     20}; 
     21 
     22function update() { 
     23        global $option, $database, $mosConfig_absolute_path; 
     24         
     25        //get versions array 
     26        $file = $mosConfig_absolute_path."/administrator/components/".$option."/versions.php"; 
     27        if(file_exists($file)) { 
     28                include($file); 
     29        } 
     30         
     31        $old_ver = file_get_contents($mosConfig_absolute_path."/administrator/components/".$option."/curr_version"); 
     32        $new_ver = file_get_contents($mosConfig_absolute_path."/administrator/components/".$option."/version"); 
     33         
     34        //get array keys 
     35        $old_key = array_search($old_ver,$versions); 
     36        $next_version = $old_key + 1; 
     37        $new_key = array_search($new_ver,$versions); 
     38         
     39        if($new_key > $old_key) { 
     40                //we have a new version installed, perform update 
     41                updateSoftware($versions[$next_version],$versions[$new_key],$versions[$old_key]); 
     42        } 
     43         
     44        //now, rename the version file 
     45        $src = $mosConfig_absolute_path."/administrator/components/com_mls_seatmap/version"; 
     46        $dst = $mosConfig_absolute_path."/administrator/components/com_mls_seatmap/curr_version"; 
     47        @rename($src,$dst); 
     48}; 
     49 
     50function updateSoftware($new_version,$final_version,$old_version) { 
     51        echo "<h3>Performing update from <b>'".$old_version."'</b> to <b>".$new_version."'</b></h3>\n"; 
     52        global $versions; 
     53        performUpdate($new_version); 
     54        ?> 
     55        <span style="font-weight: bold; color: #00FF00">Complete!</span> 
     56        <hr> 
     57        <?php 
     58        if($new_version != $final_version AND $final_version != "") { 
     59                $old_key = array_search($new_version,$versions); 
     60                $next_version = $old_key + 1; 
     61                updateSoftware($versions[$next_version],$final_version,$versions[$old_key]); 
     62        } 
     63}; 
     64 
     65function performUpdate($v) { 
     66        switch($v) { 
     67                case "0.0.2": 
     68                        update_002(); 
     69                break; 
     70        } 
     71}; 
     72 
     73function update_002() { 
     74        global $database, $mosConfig_absolute_path; 
     75        $database->setQuery( "ALTER TABLE `#__mls_seatmap_room_elements` ADD `name` VARCHAR( 10 ) NOT NULL AFTER `col`" ); 
     76        $database->query(); 
    2077}; 
    2178 
  • trunk/com_mls_seatmap/lang/dutch.php

    r60 r62  
    11<?php 
    22/** 
    3  * English language file for myLANsite Teams 
    4  * @author Samuel Suter <samuel.suter@gmx.ch
     3 * dutch language file for com_mls_seatmap 0.0.2 
     4 * @author Mathy Vanvoorden <matje@lanzone.be
    55 */ 
    66 
    77defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
    88 
    9 /** 
    10  * First, define the blocks 
    11  **/ 
    12 $lang_data = array( 
    13                         "general", 
    14                         "events", 
    15                         "participants", 
    16                         "comments", 
    17                         "reviews", 
    18                         "seats"); 
    19  
    209$lang_data["general"] = array( 
    21                                 "publish" => "Publiceren", 
    22                                 "unpublish" => "Publicatie annuleren", 
    23                                 "published" => "Gepubliceerd", 
    24                                 "unpublished" => "Publicatie geannuleerd", 
    25                                 "save" => "Opslaan", 
    26                                 "cancel" => "Annuleren", 
    27                                 "edit" => "Wijzigen", 
    28                                 "add" => "Toevoegen", 
    29                                 "new" => "Nieww", 
    30                                 "delete" => "Verwijderen", 
    31                                 "archive" => "Archief", 
    32                                 "back" => "Terug", 
    33                                 "yes" => "JA", 
    34                                 "no" => "Nee", 
    35                                 "num_display" => "Toon #", 
    36                                 "search" => "Zoeken", 
    37                                 "select_user" => "Selecteer gebruiker", 
    38                                 "select_event" => "Selecteer evenement", 
    39                                 "select_category" => "Selecteer categorie", 
    40                                 "select_room" => "Selecteer ruimte", 
    41                                 "select_status" => "Selecteer status", 
    42                                 "err_of_the" => "van de", 
    43                                 "err_defined_somewhere_else" => "IP-adressen zijn ergens anders al gedefinieerd!", 
    44                                 "err_occupy_seat" => "Je hebt al een andere plaats gereserveerd!", 
    45                                 "err_restricted_seat" => "Deze plaats is gereserveerd voor speciale personen!", 
    46                                 "err_occupied" => "Deze plaats is al bezet!", 
    47                                 "err_reserved" => "Deze plaats is al gereserveerd voor iemand anders!", 
    48                                 "msg_seat_occupied" => "Plaat is gereserveerd voor je!", 
    49                                 "msg_seat_released" => "Je hebt je plaats geselecteerd!", 
    50                                 "msg_seat_reserved" => "Je hebt deze plaats nu gereserveerd voor een vriend!", 
    51                                 "err_not_paid" => "Je hebt nog niet betaald voor dit evenement!"); 
     10                "publish" => "Publiceren", 
     11                "unpublish" => "Niet publiceren", 
     12                "published" => "Gepubliceerd", 
     13                "unpublished" => "Niet gepubliceerd", 
     14                "save" => "Opslaan", 
     15                "cancel" => "Annuleren", 
     16                "edit" => "Wijzigen", 
     17                "add" => "Toevoegen", 
     18                "new" => "Nieuw", 
     19                "delete" => "Verwijderen", 
     20                "archive" => "Archief", 
     21                "back" => "Terug", 
     22                "yes" => "JA", 
     23                "no" => "Nee", 
     24                "num_display" => "Toon #", 
     25                "search" => "Zoeken", 
     26                "select_user" => "Selecteer gebruiker", 
     27                "select_event" => "Selecteer evenement", 
     28                "select_category" => "Selecteer categorie", 
     29                "select_room" => "Selecteer ruimte", 
     30                "select_status" => "Selecteer status", 
     31                "err_of_the" => "van de", 
     32                "err_defined_somewhere_else" => "IP-adressen zijn reeds elders gedefinieerd!", 
     33                "err_names_defined_somewhere_else" => "Namen zijn reeds elders gedefinieerd!", 
     34                "err_occupy_seat" => "Je hebt al een andere plaats gereserveerd!", 
     35                "err_restricted_seat" => "Deze plaats is gereserveerd voor speciale personen!", 
     36                "err_occupied" => "Deze plaats is al bezet!", 
     37                "err_reserved" => "Deze plaats is al gereserveerd voor iemand anders!", 
     38                "msg_seat_occupied" => "Plaat is gereserveerd voor je!", 
     39                "msg_seat_released" => "Je hebt je plaats geselecteerd!", 
     40                "msg_seat_reserved" => "Je hebt deze plaats nu gereserveerd voor een vriend!", 
     41                "err_not_paid" => "Je hebt nog niet betaald voor dit evenement!"); 
    5242 
    5343$lang_data["rooms"] = array( 
    54                                 "seatmap_rooms" => "Zitplaatsen Ruimtes", 
    55                                 "seat_details" => "Plaats details", //frontend title 
    56                                 "reserve_seat" => "Plaats reserveren", //frontend title 
    57                                 "reserve" => "Reserveren", 
    58                                 "occupied_by" => "Bezet door", 
    59                                 "reserved_by" => "Gereserveerd door", 
    60                                 "reserved_for" => "Gereserveerd voor", 
    61                                 "reserved_at" => "Gereserveerd om", 
    62                                 "reserved_until" => "Gereserveerd tot", 
    63                                 "occupy" => "Bezetten", 
    64                                 "reserve" => "Reserveren", 
    65                                 "release" => "Vrijgeven", 
    66                                 "status" => "Status", 
    67                                 "status_reserved" => "Gereserveerd", 
    68                                 "status_free" => "Vrij", 
    69                                 "status_occupied" => "Bezet", 
    70                                 "ip_address" => "IP-Adres", 
    71                                 "edit_room" => "Ruimte wijzigen", 
    72                                 "add_room" => "Ruimte toevoegen", 
    73                                 "event" => "Evenement", 
    74                                 "rows" => "Rijen", 
    75                                 "cols" => "Kolommen", 
    76                                 "name" => "Naam", 
    77                                 "description" => "Beschrijving", 
    78                                 "edit_map" => "Map wijzigen", 
    79                                 "action" => "Actie", 
    80                                 "show_help" => "Toon help", 
    81                                 "single" => "Plaats enkel element", 
    82                                 "multi" => "Plaats element gebied", 
    83                                 "copy" => "Kopi�gebied", 
    84                                 "move" => "Verplaats gebied", 
    85                                 "ipblock" => "IP-Adressen toekennen", 
    86                                 "rotate" => "Roteren", 
    87                                 "reset" => "Reset", 
    88                                 "generate" => "Genereren", 
    89                                 "defined_below" => "Hieronder gedefinieerd", 
    90                                 "defined_above" => "Hierboven gedefinieerd", 
    91                                 "on_each_row" => "Op elke rij", 
    92