Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

footer.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Footer Template
  4. *
  5. * Uses HTML5, but all template HTML is (should be) xHTML 1.1 compatable
  6. */
  7. class Footer{
  8. private $scripts = array();
  9. /**
  10. * Constructor
  11. *
  12. * @param string $title - the title of the page
  13. * @param mixed $scripts - the url (or array of urls) of the script(s) to include
  14. */
  15. public function __construct($title = null, $stylesheets = null){
  16. // Page Title
  17. if (! empty($title)) $this->title = $title;
  18. if (! empty($scripts) && is_array($scripts)) $this->scripts = array_merge($scripts, $this->scripts);
  19. else if (! empty($scripts)) $this->addScript($scripts);
  20. }
  21. public function setTitle($title = "Ranks"){
  22. $this->title = $title;
  23. }
  24. public function addScript($script){
  25. if (empty($script) || strncmp($script, '/', 1) !== 0) return false;
  26. $scripts[] = $script;
  27. return true;
  28. }
  29. public function output($return = false){
  30. // End Content/page div
  31. $html = "\t\t\t\t</div>\n";
  32. $html = "\t\t\t</div>\n";
  33. // Footer content
  34. /*
  35. $html .= "\t\t\t<div class=\"footercontainer\">\n";
  36. $html .= "\t\t\t\t<div class=\"footer\">\n";
  37. $html .= "\t\t\t\t\t<h2>Copyright &copy; 2015. All Rights Reserved</h2>\n";
  38. $html .= "\t\t\t\t</div>\n";
  39. $html .= "\t\t\t</div>\n";
  40. */
  41. // End Container
  42. $html .= "\t\t</div>\n";
  43. // Add any scripts to be included at the bottom of the page.
  44. foreach ($this->scripts as $script){
  45. echo "<script type=\"text/javascript\" src=\"$script\"></script>";
  46. }
  47. $html .= "\t</body>\n";
  48. $html .= "</html>\n";
  49. if($return === true) return $html;
  50. echo $html;
  51. }
  52. }