From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- Application/Modules/ModBase.php | 41 ++++++++++++++++++++++++++++++++ Application/Modules/ModImage.php | 45 ++++++++++++++++++++++++++++++++++++ Application/Modules/ModLink.php | 18 +++++++++++++++ Application/Modules/ModLinkimage.php | 18 +++++++++++++++ Application/Modules/ModRaw.php | 18 +++++++++++++++ Application/Modules/ModTopLink.php | 32 +++++++++++++++++++++++++ Application/Modules/index.html | 1 + 7 files changed, 173 insertions(+) create mode 100644 Application/Modules/ModBase.php create mode 100644 Application/Modules/ModImage.php create mode 100644 Application/Modules/ModLink.php create mode 100644 Application/Modules/ModLinkimage.php create mode 100644 Application/Modules/ModRaw.php create mode 100644 Application/Modules/ModTopLink.php create mode 100644 Application/Modules/index.html (limited to 'Application/Modules') diff --git a/Application/Modules/ModBase.php b/Application/Modules/ModBase.php new file mode 100644 index 0000000..44d25a2 --- /dev/null +++ b/Application/Modules/ModBase.php @@ -0,0 +1,41 @@ +simpleXmlObj->classname)) + { + return " class='".$this->simpleXmlObj->classname[0]."' "; + } + return null; + } + + //wrap the html with a
+ //look for the
tag in the xml in order to set the class of the div + public function wrapDiv($string) + { + $divOpen = "
"; + $divClose = "
"; + + if (isset($this->simpleXmlObj->div)) + { + $divOpen = "
"; + } + + return $divOpen . $string . $divClose; + } + +} \ No newline at end of file diff --git a/Application/Modules/ModImage.php b/Application/Modules/ModImage.php new file mode 100644 index 0000000..5a116b1 --- /dev/null +++ b/Application/Modules/ModImage.php @@ -0,0 +1,45 @@ +simpleXmlObj->width)) + { + return " width = '" . $this->simpleXmlObj->width ."' "; + } + return null; + } + + public function heightPropertyString() + { + if (isset($this->simpleXmlObj->height)) + { + return " height = '" . $this->simpleXmlObj->height ."' "; + } + return null; + } + + public function titlePropertyString() + { + if (isset($this->simpleXmlObj->title)) + { + return " title = '" . $this->simpleXmlObj->title ."' "; + } + return null; + } + + public function render() + { + $link = "getHtmlClass().$this->widthPropertyString().$this->heightPropertyString().$this->titlePropertyString()." src='".$this->simpleXmlObj->src[0]."'>"; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/Application/Modules/ModLink.php b/Application/Modules/ModLink.php new file mode 100644 index 0000000..011bc78 --- /dev/null +++ b/Application/Modules/ModLink.php @@ -0,0 +1,18 @@ +getHtmlClass()." href='".$this->simpleXmlObj->href[0]."'>".$this->simpleXmlObj->text[0].""; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/Application/Modules/ModLinkimage.php b/Application/Modules/ModLinkimage.php new file mode 100644 index 0000000..8e49bbf --- /dev/null +++ b/Application/Modules/ModLinkimage.php @@ -0,0 +1,18 @@ +getHtmlClass()." href='".$this->simpleXmlObj->href[0]."'>widthPropertyString().$this->heightPropertyString().$this->titlePropertyString()." src='".$this->simpleXmlObj->src[0]."'>"; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/Application/Modules/ModRaw.php b/Application/Modules/ModRaw.php new file mode 100644 index 0000000..4ed3226 --- /dev/null +++ b/Application/Modules/ModRaw.php @@ -0,0 +1,18 @@ +simpleXmlObj->text[0]; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/Application/Modules/ModTopLink.php b/Application/Modules/ModTopLink.php new file mode 100644 index 0000000..6407c3e --- /dev/null +++ b/Application/Modules/ModTopLink.php @@ -0,0 +1,32 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +//module to print an HTML link +//extends the ModBase class +class ModTopLink extends ModBase { + + public function render($liclass = null) + { + return "
  • getHtmlClass()." href='".$this->simpleXmlObj->href[0]."'>".$this->simpleXmlObj->text[0]."
  • "; + } + +} \ No newline at end of file diff --git a/Application/Modules/index.html b/Application/Modules/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/Application/Modules/index.html @@ -0,0 +1 @@ + -- cgit v1.2.3