Show
Ignore:
Timestamp:
11/28/06 22:32:11 (16 years ago)
Author:
knifee
Message:

Changed the class.box.php to use smarty, and changed all pages that use the class to use the options. Menu Boxes can now be created as follows:
$menubox = new box("Menu");
$menubox->setIcon("menu-item.gif"); // only needed if adding a Menu (ie u want the little icon)
$menubox->addOption("caption","View"); // Add a Caption
$menubox->addOption("link","Name","URL"); // Add a Link
$menubox->addOption("points","Points Value"); // Add points to a Points Box
$menubox->addOption("img","/path to img"); // Add an Image

changed the AwardBox? Class to use smarty, that is called in the same way as before so no need to change anything.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/kill_detail.php

    r92 r104  
    190190$html .= "</td></tr></table>"; 
    191191 
    192 $menubox = new MenuBox(); 
    193 $menubox->addCaption("View"); 
    194 $menubox->addOption("Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=".$kill->getID()."', null, 355, 430, '' );"); 
     192$menubox = new box("Menu"); 
     193$menubox->setIcon("menu-item.gif"); 
     194$menubox->addOption("Caption","View"); 
     195$menubox->addOption("link","Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=".$kill->getID()."', null, 355, 430, '' );"); 
    195196if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) 
    196197{ 
    197     $menubox->addOption("Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); 
     198    $menubox->addOption("link","Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); 
    198199} 
    199200if ($page->isAdmin()) 
    200201{ 
    201     $menubox->addCaption("Admin"); 
    202     $menubox->addOption("Delete", "javascript:openWindow('?a=kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 
     202    $menubox->addOption("caption","Admin"); 
     203    $menubox->addOption("link","Delete", "javascript:openWindow('?a=kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 
    203204} 
    204205$page->addContext($menubox->generate()); 
     
    207208{ 
    208209    $scorebox = new Box("Points awarded"); 
    209     $scorebox->setHeight(64); 
    210     $scorebox->setContent("<div class=kill-points>".$kill->getKillPoints()."</div>"); 
     210    $scorebox->addOption("points",$kill->getKillPoints()); 
    211211    $page->addContext($scorebox->generate()); 
    212212} 
    213213 
    214214$mapbox = new Box("Map"); 
    215 $maphtml = "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=map&size=145\" border=0><br>"; 
    216 $maphtml .= "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=region&size=145\" border=0><br>"; 
    217 $maphtml .= "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145\" border=0>"; 
    218 $mapbox->setContent($maphtml); 
     215$mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=map&size=145"); 
     216$mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=region&size=145"); 
     217$mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145"); 
     218 
    219219$page->addContext($mapbox->generate()); 
    220220