Optimizer_Unit_Page.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Optimizer unit page file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @author Iñigo Valentin <i@inigovalentin.com>
  8. * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
  9. * @package SWDB
  10. */
  11. require_once(PATH::PAGE . "Page.php");
  12. require_once(PATH::ENTITY . "Unit.php");
  13. /**
  14. * Optimizer team list page model.
  15. *
  16. * @category Page
  17. */
  18. class Optimizer_Unit_Page extends Page{
  19. /**
  20. * @var Unit The unit to optimize.
  21. */
  22. private $unit;
  23. /**
  24. * Constructor.
  25. *
  26. * Retrieves the data and initializes the variables.
  27. *
  28. * @param string $id Selected unit id.
  29. */
  30. public function __construct($id){
  31. parent::__construct();
  32. $this->set_public(false);
  33. $this->set_view("optimizer_unit.php");
  34. $this->unit = new Unit($id);
  35. $this->set_title("Optimize " . $this->unit->get_title());
  36. $this->set_description("Optimize " . $this->unit->get_title() . "'s runes");
  37. $this->set_canonical("player/" . get_context()->get_player()->get_id() . "/optimize/" . $this->unit->get_id());
  38. $this->add_css("optimizer.css");
  39. $this->set_code(200);
  40. $this->set_message("OK");
  41. }
  42. /**
  43. * Retrieves the unit to optimize.
  44. *
  45. * @return Unit Unit to optimize.
  46. */
  47. public function get_unit(){
  48. return $this->unit;
  49. }
  50. }
  51. ?>