phpDocumentor component
[ class tree: component ] [ index: component ] [ all elements ]

Source for file Domains.php

Documentation is available at Domains.php

  1. <?
  2. /**
  3. * @package component
  4. * @filesource
  5. * @see HTML_COMPONENT_PAGE_PATH.'/Domains.php'
  6. * @copyright (c) http://Finn-Rasmussen.com
  7. * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
  8. * @author http://Finn-Rasmussen.com
  9. * @version 1.9
  10. * @since 21-oct-2005
  11. */
  12.  
  13. /**
  14. * The required files
  15. */
  16. require_once(HTML_PATH.'/Html.php');
  17. require_once(HTML_BASE_UTIL_PATH.'/Link.php');
  18.  
  19. /**
  20. * List the Domains and creates a link to each domain
  21. * <code>
  22. * $html = new Domains($domains);
  23. * print $html->getHtml();
  24. * Or
  25. * Domains::display($domains);
  26. * </code>
  27. * @package component
  28. */
  29.  
  30. class Domains extends Html {
  31. /**
  32. * @var array $domains The list of domains to show
  33. */
  34. var $domains = '';
  35.  
  36. /**
  37. * Constructor
  38. * @param array $domains The array of domain names
  39. */
  40. function Domains($domains) {
  41. $this->Html();
  42. $this->domains = $domains;
  43. }
  44.  
  45. /**
  46. * Builds the html, and return it for an overview of domains
  47. * @return String The html
  48. */
  49. function getHtml() {
  50. $html = $this->html;
  51. if (defined('COMPONENT_SHOW') && COMPONENT_SHOW & COMPONENT_SHOW_IMAGEROTATOR && HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
  52. if (defined('CREATE_RUNTIME_KERNEL') && CREATE_RUNTIME_KERNEL) {
  53. $html .= '<?$domains = new Domains('.$this->domains.');print $domains->getHtml();?>';
  54. } else {
  55. $total = 'Total';
  56. if (defined('LANGUAGE_EN')) {
  57. switch (LANGUAGE) {
  58. case LANGUAGE_EN:
  59. $html .= "<h1>Domain overview</h1>\r\n";
  60. $html .= "<p>This is the domains, which are in production</p>\r\n";
  61. break;
  62. case LANGUAGE_DA:
  63. // Intentionally fall through
  64. default:
  65. $total = 'Ialt';
  66. $html .= "<h1>Oversigt over Domainer</h1>\r\n";
  67. $html .= "<p>Her følger en liste over domainer der er i produktion</p>\r\n";
  68. break;
  69. }
  70. } else {
  71. $html .= "<h1>Oversigt over Domainer</h1>\r\n";
  72. $html .= "<p>Her følger en liste over domainer der er i produktion</p>\r\n";
  73. }
  74. $html .= "<hr />\r\n<ul>\r\n";
  75. foreach($this->domains as $key=>$value) {
  76. $no = $key+1;
  77. if (strlen($no)==1) {
  78. $no = '0'.$no;
  79. }
  80. $link = new Link($value,'http://'.$value.'/','',$no,'li','_blank');
  81. $html .= $link->getHtml();
  82. }
  83. $html .= "</ul>\r\n";
  84. $html .= "<p>$total: $no</p>\r\n";
  85. }
  86. } else {
  87. $html .= "<!-- No Domains object -->\r\n";
  88. }
  89. return $html;
  90. }
  91.  
  92. /**
  93. * Display html
  94. * <code>
  95. * Usage:
  96. * Domains::display($domains);
  97. * </code>
  98. * @static
  99. * @param array $domains The array of domain names
  100. */
  101. function display($domains) {
  102. $html = new Domains($domains);
  103. $html->addHtml();
  104. }
  105. }
  106. ?>

Documentation generated on Thu, 22 Dec 2005 17:07:32 +0100 by phpDocumentor 1.3.0RC3